diff options
author | Hans Hagen <pragma@wxs.nl> | 2022-10-14 10:56:48 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2022-10-14 10:56:48 +0200 |
commit | 0aa93a6d31a45d8df2d8516567b98967ce04f183 (patch) | |
tree | 7e1942650512f1994ca56c1eba245973240d4b71 /metapost/context/base/mpxl/mp-math.mpxl | |
parent | c161b7d6fe142231346cc1844e6e27c0ab7718c1 (diff) | |
download | context-0aa93a6d31a45d8df2d8516567b98967ce04f183.tar.gz |
2022-10-14 10:15:00
Diffstat (limited to 'metapost/context/base/mpxl/mp-math.mpxl')
-rw-r--r-- | metapost/context/base/mpxl/mp-math.mpxl | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/metapost/context/base/mpxl/mp-math.mpxl b/metapost/context/base/mpxl/mp-math.mpxl index 404d42160..3d9ad81d3 100644 --- a/metapost/context/base/mpxl/mp-math.mpxl +++ b/metapost/context/base/mpxl/mp-math.mpxl @@ -172,6 +172,16 @@ else : % decimal fi ; +%D Variant on post to the mailing list by MC: + +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 ; + permanent m_acos, m_acosh, m_asin, m_asinh, m_atan, m_atantwo, m_atanh, m_cbrt, m_ceil, m_copysign, m_cos, m_cosh, m_deg, m_erf, m_erfc, m_exp, m_exptwo, m_expm, m_fabs, |