On Fri, 14 Oct 2022 10:07:19 +0200
Hans Hagen via ntg-context <ntg-context@ntg.nl> wrote:

> So you suggest to add atantwo? As side note, you can redure your 
> definition to:
> 
>      vardef atantwo(expr dy, dx) =
>          if dx == 0 :
>              if dy < 0 : - fi pi / 2
>          else :
>              atan(dy/dx) if dx > 0 : if dy < 0 : - else : + fi pi fi
>          fi
>      enddef ;
> 
> going further makes us end up in an one-line obscurity

An absurdity, as further discussion on this thread has shown:
atan is derived from angle, which is essentially atan2.
There is no need to circle around.

As a side point, I now use MP doubleprecision mode by default, although
I do believe that it is still preferable to use classic scaled integer
mode (and minifun) for text graphical embellishments. The only
practical point to consider when using doubleprecision mode for me is
the need to explicitly use format with "decimal i" to round the text
rendering of numbers.

Alan
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

Reply via email to