Type vecteur documenté
[mp-gdd.git] / gdd-fct.mp
1 numeric Pi;
2 numeric E;
3
4 Pi := 3.14159265;
5 E  := 2.71828183;
6
7 vardef sin(expr x) = sind(x/Pi*180) enddef;
8 vardef cos(expr x) = cosd(x/Pi*180) enddef;
9 vardef tan(expr x) = sin(x)/cos(x) enddef;
10
11 vardef exp(expr x) = E**x enddef;
12
13 vardef ln(expr x) = mlog(x)/256 enddef;
14 vardef ch(expr x) = (E**x + E**(-x))/2 enddef;
15 vardef sh(expr x) = (E**x - E**(-x))/2 enddef;
16 vardef th(expr x) = (E**(2*x) - 1)/(E**(2*x) + 1) enddef;
17
18 vardef arcsin(expr t) = angle((sqrt(1-t**2),t)) / 180 * Pi enddef;
19 vardef arccos(expr t) = angle(t,(sqrt(1-t**2))) / 180 * Pi enddef;
20 vardef arctan(expr t) = angle(1,t) / 180 * Pi enddef;
21
22 endinput

Licence Creative Commons Les fichiers de Syracuse sont mis à disposition (sauf mention contraire) selon les termes de la
Licence Creative Commons Attribution - Pas d’Utilisation Commerciale - Partage dans les Mêmes Conditions 4.0 International.