\documentclass[12pt]{article}
\usepackage{fontspec}
\usepackage[metapost={-interaction=nonstopmode}]{mpgraphics}
\configure[mpggraphic][linecolor=black]
\configure[mpggraphic][linewidth=.2pt]
\configure[mpggraphic][rulesep=8pt]

\pagestyle{empty} \topmargin -1in \headsep 10pt \footskip 0pt

\begin{document}
\centerline {\large Trisectoarea lui Pascal $w=z(z+1),\,z\in\mathcal{C},\,|z|=1$}

\begin{mpdisplay}
defaultfont := "pcrr8r";
vardef limacon(expr Z) = Z zscaled (Z + right) enddef;  % = z(z+1), z=x+iy

pair k[];
for fi=0 step 0.5 until 360:
    k[fi] := limacon(dir fi);  % limacon( (cosd fi, sind fi) );
endfor

def scaleandshift(expr N) = scaled 25 shifted (N, 0) enddef;

def plotbypoints(expr N) =  % plotează punctele curbei, în (a) sau (c)
    pickup pensquare scaled .6;
    for i=0 step 0.5 until 360:
        draw k[i] scaleandshift(N);
    endfor
enddef;

def marks(expr L) =  % etichetează uniform nodurile de bază ale unui contur
    pickup pencircle scaled 2.5; pair Z;
    for t=0 upto length(q):
        Z := point t of q; 
        draw Z;
        if(L):
            label(decimal(t+1), 7 unitvector(direction t of q) 
                                rotated(-90) shifted Z) withcolor blue;
        fi;
    endfor
enddef;

z1 = ((-1+sqrt(33))/16, sqrt((207+33*sqrt(33))/2)/8);  % punctul cel mai înalt al curbei
z2 = ((-1-sqrt(33))/16, sqrt((207-33*sqrt(33))/2)/8);
z3 = z2 reflectedabout((0,0), (2,0));
atan2 = angle(1, 2) + 180;  % panta tangentei în (-1,1) este arctg(2)
path bpath, q;  % în 'q' vom scala după caz 'bpath'
bpath := (2,0){up} .. z1{left} .. (-1,1){dir atan2} .. (-1,0) .. z3{right} .. {up}(0,0);

def figlabels =  % etichetarea celor trei grafice
    z5 = z1 reflectedabout((0,0), (2,0));
    for i=0 upto 2:
        label.bot(substring(3i,3*(i+1)) of "(a)(b)(c)" infont "ptmr8r" scaled 1.1, 
                  z5 scaleandshift(10+i*115) + (0, -5));
    endfor
enddef;

%% "programul principal"
plotbypoints(10);

q := bpath scaleandshift(125);
pickup pencircle; 
draw q withcolor blue;
marks(true);

plotbypoints(240);
q:= bpath scaleandshift(240); 
pickup pencircle; draw q withcolor .8blue;
marks(false);

figlabels;
\end{mpdisplay}

În cazul (a) curba este construită "punct cu punct".

\smallskip În (b) am indicat anumite 6 puncte şi am folosit operatorul MetaFont \\
{\em path\_join} {\small(interpolează între puncte, prin arce de curbe Bézier)}.

\smallskip În (c) am suprapus construcţia (b) peste cea din (a).

\end{document}
