[NTG-context] atan2 function

Max Chernoff mseven at telus.net
Thu Oct 13 08:42:27 CEST 2022


Hi,

> How is atan2 called? I rolled my own as follows:

> Is atan with two parameters supposed to behave like atan2?

At mp-math.mpxl:167 there is:

       vardef atan   primary x = angle(1,x)       enddef ;
   
The MetaPost manual says:

   The angle operator takes a pair and computes the two-argument
   arctangent; i.e., angle is the inverse of the dir operator
   
So it looks like "angle" is the function that you want for "atan2". 

Thanks,
-- Max


More information about the ntg-context mailing list