v / vlib / math
Raw file | 33 loc (25 sloc) | 635 bytes | Latest commit hash 1cfc4198f
1module math
2
3fn JS.Math.acos(x f64) f64
4
5fn JS.Math.asin(x f64) f64
6
7fn JS.Math.atan(x f64) f64
8
9fn JS.Math.atan2(y f64, x f64) f64
10
11// acos calculates inverse cosine (arccosine).
12[inline]
13pub fn acos(a f64) f64 {
14 return JS.Math.acos(a)
15}
16
17// asin calculates inverse sine (arcsine).
18[inline]
19pub fn asin(a f64) f64 {
20 return JS.Math.asin(a)
21}
22
23// atan calculates inverse tangent (arctangent).
24[inline]
25pub fn atan(a f64) f64 {
26 return JS.Math.atan(a)
27}
28
29// atan2 calculates inverse tangent with two arguments, returns the angle between the X axis and the point.
30[inline]
31pub fn atan2(a f64, b f64) f64 {
32 return JS.Math.atan2(a, b)
33}