forked from lep/jassdoc
/
math.j
136 lines (100 loc) · 2.8 KB
/
math.j
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
// MathAPI
/**
Converts degrees into radians. This is similar to multiplying the degree value by pi / 2.
@note This is slightly more accurate than multiplying the degree value
by `bj_PI / 2`. `bj_PI` has a value of 3.14159. This native uses a pi value closer to 3.141592496.
@param degrees The degree input.
@pure
*/
native Deg2Rad takes real degrees returns real
/**
Converts a radian value into its degree equivalent.
@param radians The radian value to be converted.
@pure
*/
native Rad2Deg takes real radians returns real
/**
Takes a real value input in radians and returns its sine value. The domain of
the input is all real numbers and the range of the output is -1 to 1 inclusive.
@param radians The input radians.
@pure
*/
native Sin takes real radians returns real
/**
Takes a real value input in radians and returns its cosine value. The domain of
the input is all real numbers and the range of the output is -1 to 1 inclusive.
@param radians The input radians.
@pure
*/
native Cos takes real radians returns real
/**
Takes a real value input in radians and returns its tangent value.
@param radians The input radians.
@pure
*/
native Tan takes real radians returns real
/**
Arcsine, one of inverse trigonometric functions. The result is returned in
radians in range [-Pi/2;Pi/2].
Expect values between -1 and 1...returns 0 for invalid input
@pure
*/
native Asin takes real y returns real
/**
Arctangent, one of inverse trigonometric functions. The result is returned in
radians in range [-Pi/2;Pi/2].
Expect values between -1 and 1...returns 0 for invalid input
@pure
*/
native Acos takes real x returns real
/**
Expect values between -1 and 1
Returns 0 for invalid input
@pure
*/
native Atan takes real x returns real
/**
Arctangent function with two arguments.
The result is returned in radians in range (-Pi;Pi].
Returns 0 if x and y are both 0
@pure
*/
native Atan2 takes real y, real x returns real
/**
Returns the square root of x.
If x is less than or equal to zero this returns 0.0
@pure
*/
native SquareRoot takes real x returns real
/**
Computes x to the y'th power.
If y is zero this returns 1.0 and if both x is zero and y is less than zero this returns 0.0
@pure
*/
native Pow takes real x, real power returns real
// Bit Operations
/**
@pure
@patch 1.31
*/
native BlzBitOr takes integer x, integer y returns integer
/**
@pure
@patch 1.31
*/
native BlzBitAnd takes integer x, integer y returns integer
/**
@pure
@patch 1.31
*/
native BlzBitXor takes integer x, integer y returns integer
/**
@pure
@patch 1.31
*/
native BlzConvertColor takes integer a, integer r, integer g, integer b returns integer
/**
@patch 1.32
@pure
*/
constant native MathRound takes real r returns integer