%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % myPlot Function %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function myplot(X,Y,T) global X1; global Y1; global X2; global Y2; global P1; global P2; global P3; global L1; global L2; global L3; global R; hold off; hold on; % Large Number ZZ = P1 * 2; % Convert T to th th = atan(T) * 2; A1 = (X + L3 * cos(th)); B1 = (Y + L3 * sin(th)); A2 = (X + L2 * cos(th + R)); B2 = (Y + L2 * sin(th + R)); plot([0 X], [0 Y], 'r'); % Draw P1 plot([X1 A1], [Y1 B1], 'r'); % Draw P2 plot([X2 A2], [Y2 B2], 'r'); % Draw P3 % Draw the blue dots plot([X A1 A2], [Y B1 B2], 'o'); % Draw the triangle plot([A2 A1], [B2 B1]); % Draw L1 plot([X A2], [Y B2]); % Draw L2 plot([X A1], [Y B1]); % Draw L3 % Draw the axisw plot([-ZZ ZZ], [0 0]); plot([0 0], [-ZZ ZZ]); end