%% 直线为轴中心对称的圆
clc;
clear;
hold on
syms x y;
% 画对称轴
x1=-20:0.1:20;
k=1;
b1=10;
f1(x)=k.*x+b1;
plot(x1,f1(x1));
theta=0:2*pi/3600:2*pi;
R=4;
Circle1=10+R*cos(theta);
Circle2=10+R*sin(theta);
plot(Circle1,Circle2,'m','Linewidth',3);
x1=Circle1;
y1=Circle2;
% 对称点坐标(2*x0-x1,2f(x0)-y1)
b0=y1+(1/k).*x1;
x0=(b0-b1).*(k/(k^2+1));
x2=2*x0-x1;
y2=2*f1(x0)-y1;
plot(x2,y2,'r-');
axis equal
%% 直线为轴中心对称的三角形
close all; clear all; clc
hold on
x1=-20:0.1:20;
syms x
k=1/2;
b1=4;
f1(x)=k.*(x+2)+b1;
plot(x1,f1(x1),'b');
x1=1;x2=2;x3=1;
y1=1;y2&