[metapost] Metafun : is "atan" the arctangent function?

Dirk Laurie dirk.laurie at gmail.com
Sun Jan 12 18:25:11 CET 2014


2014/1/12 John Kitzmiller <jkitzm at gmail.com>:

> atan is vardef'd in mp-tool.mpiv as: x = x-(x**3)/3+(x**5)/5-(x**7)/7 ,
> part of the infinite series form. Maybe better to use asin(a/sqrt(a**2+1))?

Or use the builtin `angle`.

$ mf null
This is METAFONT, Version 2.718281 (TeX Live 2012)
(/usr1/local/texlive/2012/texmf-dist/metafont/base/null.mf)

* Pi=3.141592653589793;

* vardef atan(expr t) = angle(1,t)*Pi/180 enddef;

* show atan(1);
>> 0.7854


More information about the metapost mailing list