Re: metapost spiral

Hans Hagen via ntg-context <[email protected]>
Newsgroups gmane.comp.tex.context
Message-ID <[email protected]>
On 3/30/2026 12:52 PM, Hraban Ramm wrote:
> Hi,
> 
> in https://tug.ctan.org/info/drawing-with-metapost/Drawing-with-Metapost.pdf
> I found this code to draw a spiral:
> 
> path S;
> S = origin
> for t=1 upto 90:
>    .. 1/12 t * dir 16t
> endfor;
> draw S;
> 
> I understand it starts at origin and adds a number of points – but where 
> are the points (pairs)? There’s a number (distance?) and a direction 
> (angle?). Could you explain this in layman’s terms?

"dir" produces a pair

\startMPpage
path S;
S := origin for t=1 upto 90 : .. 1/12 t * dir 16t endfor ;
S := S scaled 10 ;
draw S ;
drawpoints S withcolor red ;
\stopMPpage


> If I try a different starting point than origin, the spiral still is 
> drawn around origin. I'd like to add it to another path and also 
hm, if you replace origin by (10,10) it does looks different

 > randomize the points a bit to make it look hand-drawn.

1/12 (t randomized .05t)

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : [email protected] / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.