L3=3; L2=3*2^(1/2); theta=2.511671398409057; x=g(theta); y=h(theta); gamma=pi/4; x1=5; x2=0; y2=6; plot([x x+L3*cos(theta) x+L2*cos(theta+gamma) x],[y y+L3*sin(theta) y+L2*sin(theta+gamma) y],'r'); hold on plot([0 x1 x2],[0 0 y2],'bo'); hold on plot([0 x],[0 y],'g',[x1 x+L3*cos(theta)],[0 y+L3*sin(theta)],'g',[x2 x+L2*cos(theta+gamma)],[y2 y+L2*sin(theta+gamma)],'g'); axis square;