This file contains a math functions.
MODULE_MATH | 1 |
MATH_ROUND | 0 |
MATH_FLOOR | 1 |
MATH_CEIL | 2 |
MATH_ABS | 3 |
MATH_NEG | 4 |
MATH_RANDOM | 5 |
MATH_SIN | 6 |
MATH_COS | 7 |
MATH_TAN | 8 |
MATH_ASIN | 9 |
MATH_ACOS | 10 |
MATH_ATAN | 11 |
MATH_REMAINDER | 12 |
MATH_EXP | 13 |
MATH_SQRT | 14 |
MATH_LOG | 15 |
MATH_POW | 16 |
MATH_ODD | 17 |
MATH_EVEN | 18 |
MATH_IK_RAD | 19 |
MATH_IK_DEG | 20 |
PI | 3.14159265359 |
TAU | 6.283185307179586 |
Round a number.
proc round(number n)
Name | Type | Description |
---|---|---|
n | number | The number to round. |
Round a value to the closest integer value.
"lib/modules/standard.whl" "lib/modules/math.whl" "lib/modules/screen.whl" proc main() number a number b a = 0.6 ; b will be a rounded up to 1 b = round(a) drawNumber(10, 10, a) drawNumber(10, 30, b) a = 2.4 ; b will be a rounded down to 2 b = round(a) drawNumber(10, 60, a) drawNumber(10, 80, b) halt() end
Round a number down.
proc floor(number n)
Name | Type | Description |
---|---|---|
n | number | The number to round down. |
Round a value down to the closest integer value.
"lib/modules/standard.whl" "lib/modules/math.whl" "lib/modules/screen.whl" proc main() number a number b a = 6.99 ; b will be a rounded down to 6 b = floor(a) drawNumber(10, 10, a) drawNumber(10, 30, b) a = -2.4 ; b will be a rounded down to -3 b = floor(a) drawNumber(10, 60, a) drawNumber(10, 80, b) halt() end
Round a number up.
proc ceil(number n)
Name | Type | Description |
---|---|---|
n | number | The number to round up. |
Round a value up to the closest integer value.
"lib/modules/standard.whl" "lib/modules/math.whl" "lib/modules/screen.whl" proc main() number a number b a = 15.01 ; b will be a rounded up to 16 b = ceil(a) drawNumber(10, 10, a) drawNumber(10, 30, b) a = -19.4 ; b will be a rounded up to -19 b = ceil(a) drawNumber(10, 60, a) drawNumber(10, 80, b) halt() end
Make a number positive.
proc abs(number n)
Name | Type | Description |
---|---|---|
n | number | The number to make positive. |
Get the absolute value.
"lib/modules/standard.whl" "lib/modules/math.whl" "lib/modules/screen.whl" proc main() number a number b a = -9 ; b will be the positive value of a (9) b = abs(a) drawNumber(10, 10, a) drawNumber(10, 30, b) a = 67 ; b will be the same value as a (67) b = abs(a) drawNumber(10, 60, a) drawNumber(10, 80, b) halt() end
Make a number negative.
proc neg(number n)
Name | Type | Description |
---|---|---|
n | number | The number to make negative. |
Get the negative value.
"lib/modules/standard.whl" "lib/modules/math.whl" "lib/modules/screen.whl" proc main() number a number b a = -72 ; b will be the positive value of a (72) b = neg(a) drawNumber(10, 10, a) drawNumber(10, 30, b) a = 13 ; b will be the negative value of a (-13) b = neg(a) drawNumber(10, 60, a) drawNumber(10, 80, b) halt() end
Get a random number.
proc random(number min, number max)
Name | Type | Description |
---|---|---|
min | number | The minimum value. |
max | number | The maximum value, the random value is always less than the maximum value. |
Get the sine value for an angle in radians.
proc sin(number angle)
Name | Type | Description |
---|---|---|
angle | number | The angle. |
Get the cosine value for an angle in radians.
proc cos(number angle)
Name | Type | Description |
---|---|---|
angle | number | The angle. |
Return tangent geometry value in radians.
proc tan(number value)
Name | Type | Description |
---|---|---|
value | number | The value. |
Get the arcsine value for a value.
proc asin(number value)
Name | Type | Description |
---|---|---|
value | number | The value. |
Get the arccosine value for a value.
proc acos(number value)
Name | Type | Description |
---|---|---|
value | number | The value. |
Get the arctan value for a value.
proc atan(number value)
Name | Type | Description |
---|---|---|
value | number | The value. |
Get the remainder (modulo) of a value.
proc remainder(number value, number remainder)
Name | Type | Description |
---|---|---|
value | number | The value. |
remainder | number | The remainder. |
Get the exp value of a value.
proc exp(number value)
Name | Type | Description |
---|---|---|
value | number | The value. |
Get the square root value of a value.
proc sqrt(number value)
Name | Type | Description |
---|---|---|
value | number | The value. |
Get the logarithm value of a value.
proc log(number value)
Name | Type | Description |
---|---|---|
value | number | The value. |
Get base to the exponent power.
proc pow(number base, number exponent)
Name | Type | Description |
---|---|---|
base | number | The base value. |
exponent | number | The exponent value. |
Check if a number is odd.
proc odd(number value)
Name | Type | Description |
---|---|---|
value | number | The value to check. |
Check if a number is even.
proc even(number value)
Name | Type | Description |
---|---|---|
value | number | The value to check. |
Calculate the inverse kinimatic angles in radians based on the `ikData` record. This procedure is only supported in the IDE.
proc ikRad()
Calculate the inverse kinimatic angles in degrees based on the `ikData` record. This procedure is only supported in the IDE.
proc ikDeg()