Guest User

Untitled

a guest
Jan 20th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. % First part : solving constraints to obtain parameters values
  2. syms a b c
  3. % 3 equations with 3 unknowns :
  4. eq1=(1+4*a-2)^2+(2-3*a-3)^2==(3*b-2)^2+(1+4*b-3)^2;%PA^2=PB^2
  5. eq2=(1+4*a-2)^2+(2-3*a-3)^2==((3*c-2)^2+(1+4*c-3)^2;%PA^2=PC^2
  6. eq3=(3*b-1)*(1+4*a-3*c)+(1+4*b-2)*((2-3*a)-(1+4*c))==0;%HB orth. to CA
  7. [A,B,C]=solve([eq1,eq2,eq3],a,b,c)
  8. %
  9. % second part : plotting one of the results
  10. clear all;close all;hold on;axis equal;grid on;
  11. xAB=@(t)(3*t);yAB=@(t)(1+4*t);% param. equ. of line AB
  12. T=0:0.1:1;plot(xAB(T),yAB(T),LS,'on');
  13. xH=1;yH=2;plot(xH,yH,'*r');text(xH+0.1,yH,'H');
  14. xP=2;yP=3;plot(xP,yP,'*r');text(xP-0.2,yP,'P');
  15. m=4/25;p=(14+3*sqrt(6))/25;n=(14-3*sqrt(6))/25;%param. values obtain in the first part;
  16. xA=@(a)(1+4*a);yA=@(a)(2-3*a);plot(xA(m),yA(m),'ob');text(xA(m),yA(m)-0.2,'A')
  17. 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')
  18. xC=@(c)(3*c);yC=@(c)(1+4*c);plot(xC(p),yC(p),'ob');text(xC(p)+0.2,yC(p),'C')
  19. plot([xC(p),xA(m),xB(n)],[yC(p),yA(m),yB(n)],LS,'on')
Add Comment
Please, Sign In to add comment