Re: metapost spiral

Mikael Sundqvist <[email protected]>
Newsgroups gmane.comp.tex.context
Message-ID <CAHy-LL_o3aKzqjywbpYsjkYHMBThyBigzrihqwF6CJFB9QF+5g@mail.gmail.com>
Hi,

The secret is in dir that takes an angle and outputs a vector pointing
in the corresponding direction. When t = 7 for example

  .. 1/12 t * dir 16t

will equal

.. 1/12 * 7 * (cosd(16*7),sind(16*7))

/Mikael

On Mon, 30 Mar 2026 at 12:56, Hraban Ramm <[email protected]> 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?
>
> 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 randomize the points a bit to make it look hand-drawn.
>
> Hraban
>
>
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________
___________________________________________________________________________________
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.