%% mPICm12.m (figure 12)
%% mathsPIC dynamic figure
%%-------------------
\documentclass[a4paper]{article}
\usepackage{pictexwd}
\begin{document}
%%---------------------
\beginpicture
paper{units(mm), xrange(5,110), yrange(0,45)}
point(A){15,5}[$\odot$,1.2]
point(P){A, shift(10,30)}[$\odot$,1.2]
point(B){A, polar(45,60 deg)}
point(Q){perpendicular(P,AB)}
drawRightangle(PQA,2)
drawpoints(ABPQ)
drawline(ABPQ)
drawincircle(PQB)
text($A$){A,shift(-5, 0)}
text($B$){B,shift(5, 0)}
text($P$){P,shift(-5, 0)}
point(S){pointOnLine(QP,-5)}
text($Q$){S}
point(N){A,shift(0,10)}
\setdashes
drawline(AN)
\setsolid
drawAngleArrow{angle(NAB),radius(5.7),clockwise,internal}

%%--------- second figure

point*(A){60,5}[$\odot$,1.2]
point*(P){A, shift(10,30)}[$\odot$,1.2]
point*(B){A, polar(45,5 deg)} %%5 60 deg
point*(Q){perpendicular(P,AB)}
drawRightangle(PQA,2)
drawpoints(ABPQ)
drawline(ABPQ)
drawincircle(PQB)
text($A$){A,shift(-5, 0)}
text($B$){B,shift(5, 0)}
text($P$){P,shift(-5, 0)}
point*(S){pointOnLine(QP,-5)}
text($Q$){S}
point*(N){A,shift(0,10)}
\setdashes
drawline(AN)
\setsolid
drawAngleArrow{angle(NAB),radius(5.7),clockwise,internal}

%%------
\endpicture
\end{document}