%theta= Input value for theta; x=N1/D; y=N2/D; u1=x; u2=x+L2*cos(theta+gamma); u3=x+L3*cos(theta); v1=y; v2=y+L2*sin(theta+gamma); v3=y+L3*sin(theta); plot([u1 u2 u3 u1],[v1 v2 v3 v1], 'r'); hold on plot([0 x1 x2],[0 0 y2],'bo'); plot([u1, 0], [v1, 0]); plot ([u2 x2], [v2 y2]); plot([u3 x1], [v3 0]); hold on theta=pi/4;