summaryrefslogtreecommitdiff
path: root/info/drawing-with-metapost/src/curves-astroid-family.mp
blob: 340144f721d8091b2ca9fe15703bc6e2bd960d5c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
\documentclass[border=5mm]{standalone}
\usepackage{luamplib}
\begin{document}
\mplibtextextlabel{enable}
\begin{mplibcode}
input colorbrewer-rgb
beginfig(1);
    numeric a; a = 144;
    for n=1 upto 7:
        path p; p = a * right for t=6 step 6 until 90:
            .. a * (cosd(t) ** n, sind(t) ** n)
        endfor;
        p := for i=0 upto 3: p rotated 90i & endfor cycle;
        fill p withcolor Oranges[9][n]; draw p;
    endfor
endfig;
\end{mplibcode}
\end{document}