Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- % First part : solving constraints to obtain parameters values
- syms a b c
- % 3 equations with 3 unknowns :
- eq1=(1+4*a-2)^2+(2-3*a-3)^2==(3*b-2)^2+(1+4*b-3)^2;%PA^2=PB^2
- eq2=(1+4*a-2)^2+(2-3*a-3)^2==((3*c-2)^2+(1+4*c-3)^2;%PA^2=PC^2
- eq3=(3*b-1)*(1+4*a-3*c)+(1+4*b-2)*((2-3*a)-(1+4*c))==0;%HB orth. to CA
- [A,B,C]=solve([eq1,eq2,eq3],a,b,c)
- %
- % second part : plotting one of the results
- clear all;close all;hold on;axis equal;grid on;
- xAB=@(t)(3*t);yAB=@(t)(1+4*t);% param. equ. of line AB
- T=0:0.1:1;plot(xAB(T),yAB(T),LS,'on');
- xH=1;yH=2;plot(xH,yH,'*r');text(xH+0.1,yH,'H');
- xP=2;yP=3;plot(xP,yP,'*r');text(xP-0.2,yP,'P');
- m=4/25;p=(14+3*sqrt(6))/25;n=(14-3*sqrt(6))/25;%param. values obtain in the first part;
- xA=@(a)(1+4*a);yA=@(a)(2-3*a);plot(xA(m),yA(m),'ob');text(xA(m),yA(m)-0.2,'A')
- xB=@(b)(3*b);yB=@(b)(1+4*b);plot(xB(n),yB(n),'ob');text(xB(n)-0.3,yB(n)+0.1,'B')
- xC=@(c)(3*c);yC=@(c)(1+4*c);plot(xC(p),yC(p),'ob');text(xC(p)+0.2,yC(p),'C')
- plot([xC(p),xA(m),xB(n)],[yC(p),yA(m),yB(n)],LS,'on')
Add Comment
Please, Sign In to add comment