summaryrefslogtreecommitdiff
path: root/metapost
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2021-04-09 20:43:45 +0200
committerContext Git Mirror Bot <phg@phi-gamma.net>2021-04-09 20:43:45 +0200
commit9191d12efe40ce045f76b695fc5c02fa6a1a7d6a (patch)
treec9537c13c71ee54be562cd8124cf04405e34f937 /metapost
parenta41fe00a674c46d923de837778e9ee44565dc341 (diff)
downloadcontext-9191d12efe40ce045f76b695fc5c02fa6a1a7d6a.tar.gz
2021-04-09 19:56:00
Diffstat (limited to 'metapost')
-rw-r--r--metapost/context/base/mpxl/mp-math.mpxl20
1 files changed, 17 insertions, 3 deletions
diff --git a/metapost/context/base/mpxl/mp-math.mpxl b/metapost/context/base/mpxl/mp-math.mpxl
index cfe9e55e6..404d42160 100644
--- a/metapost/context/base/mpxl/mp-math.mpxl
+++ b/metapost/context/base/mpxl/mp-math.mpxl
@@ -157,7 +157,18 @@ if (numbersystem == "scaled") or (numbersystem == "double") :
% vardef tand primary x = sind(x)/cosd(x) enddef ;
% vardef cotd primary x = cosd(x)/sind(x) enddef ;
- permanent sin, cos, tan, sinh, cosh, tanh, asin, acos, atan, asinh, acosh, atanh, invsin, invcos, invtan, asind, acosd, atand ;
+else : % decimal
+
+ vardef sin primary x = sind(x*radian) enddef ;
+ vardef cos primary x = cosd(x*radian) enddef ;
+ vardef tan primary x = sin(x)/cos(x) enddef ;
+ vardef asin primary x = angle((1+-+x,x)) enddef ;
+ vardef acos primary x = angle((x,1+-+x)) enddef ;
+ vardef atan primary x = angle(1,x) enddef ;
+
+ vardef invsin primary x = (asin(x))/radian enddef ;
+ vardef invcos primary x = (acos(x))/radian enddef ;
+ vardef invtan primary x = (atan(x))/radian enddef ;
fi ;
@@ -177,7 +188,10 @@ permanent
% sqrt, sind, cosd, % these are primitives
- sqr, log, ln, exp, inv, sin, cos, tan, asin, acos, atan, invsin, invcos, invtan,
- tand, asind, acosd, atand, tand, cotd
+ sqr, log, ln, exp, inv,
+ sin, cos, tan, asin, acos, atan, invsin, invcos, invtan,
+ tand, cotd,
+ sinh, cosh, tanh, asinh, acosh,
+ atanh, asind, acosd, atand
;