Arcade
|
Provides constants and static methods for floating point mathematics. More...
Static Public Member Functions | |
static float | Sqrt (float val) |
Returns the square root of a specified number. More... | |
static float | Cos (float radians) |
Returns the cosine of the specified angle. More... | |
static float | Sin (float radians) |
Returns the sine of the specified angle. More... | |
static float | Tan (float radians) |
Returns the tangent of the specified angle. More... | |
static float | Atan2 (float y, float x) |
Returns the angle whose tangent is the quotient of two specified numbers. More... | |
static float | Floor (float val) |
Returns the largest integer less than or equal to the specified single-precision floating-point number. More... | |
static int | FloorToInt (float val) |
Returns the largest integer less than or equal to the specified single-precision floating-point number. More... | |
static float | Round (float val) |
Rounds a single-precision floating-point value to the nearest integral value. More... | |
static int | RoundToInt (float val) |
Rounds a single-precision floating-point value to the nearest integral value. More... | |
static float | Ceiling (float val) |
Returns the smallest integer greater than or equal to the specified single-precision floating-point number. More... | |
static int | CeilingToInt (float val) |
Returns the smallest integer greater than or equal to the specified single-precision floating-point number. More... | |
static float | Pow (float val, float pow) |
Returns a specified number raised to the specified power. More... | |
static float | Clamp (float val, float min, float max) |
Returns val if it is between min and max , otherwise it returns whichever of those two bounds it is closest to. More... | |
static int | Clamp (int val, int min, int max) |
Returns val if it is between min and max , otherwise it returns whichever of those two bounds it is closest to. More... | |
static float | Log (float val) |
Returns the natural (base e) logarithm of a specified number. More... | |
static float | Log (float val, float newBase) |
Returns the logarithm of a specified number in a specified base. More... | |
static float | Random () |
Returns a random floating-point number that is greater than or equal to 0.0, and less than 1.0. More... | |
static int | Random (int max) |
Returns a non-negative random integer that is less than the specified maximum. More... | |
static int | Random (int min, int max) |
Returns a random integer that is within a specified range. More... | |
static float | Random (float max) |
Returns a random floating-point number that is greater than or equal to 0.0, and less than max . More... | |
static float | Random (float min, float max) |
Returns a random floating-point number that is greater than or equal to min , and less than max . More... | |
static Vector2F | RandomUnitVector () |
Returns a normalized floating-point vector pointing in a uniformly random direction. More... | |
static Vector2F | RandomVector () |
Returns a random floating-point vector with X and Y components in the range [0-1]. More... | |
static bool | LinesIntersect (Vector2F a0, Vector2F a1, Vector2F b0, Vector2F b1) |
Returns true if and only if the two given line segments intersect. More... | |
static bool | LinesIntersect (Vector2F a0, Vector2F a1, Vector2F b0, Vector2F b1, out Vector2F pos) |
Returns true if and only if the two given line segments intersect. If an intersection is found the pos parameter will be set to the intersection position, otherwise it is set to the position where the lines would intersect if they were infinitely long. For parallel lines, pos is set to the zero vector. More... | |
Public Attributes | |
const float | PI = (float) Math.PI |
Represents the ratio of the circumference of a circle to its diameter, specified by the constant, π. More... | |
Provides constants and static methods for floating point mathematics.
|
inlinestatic |
Returns the angle whose tangent is the quotient of two specified numbers.
|
inlinestatic |
Returns the smallest integer greater than or equal to the specified single-precision floating-point number.
|
inlinestatic |
Returns the smallest integer greater than or equal to the specified single-precision floating-point number.
|
inlinestatic |
Returns val if it is between min and max , otherwise it returns whichever of those two bounds it is closest to.
val | Value to clamp. |
min | Lower bound. |
max | Upper bound. |
|
inlinestatic |
Returns val if it is between min and max , otherwise it returns whichever of those two bounds it is closest to.
val | Value to clamp. |
min | Lower bound. |
max | Upper bound. |
|
inlinestatic |
Returns the cosine of the specified angle.
|
inlinestatic |
Returns the largest integer less than or equal to the specified single-precision floating-point number.
|
inlinestatic |
Returns the largest integer less than or equal to the specified single-precision floating-point number.
|
inlinestatic |
Returns true if and only if the two given line segments intersect.
a0 | Start of the first line. |
a1 | End of the first line. |
b0 | Start of the second line. |
b1 | End of the second line. |
|
inlinestatic |
Returns true if and only if the two given line segments intersect. If an intersection is found the pos parameter will be set to the intersection position, otherwise it is set to the position where the lines would intersect if they were infinitely long. For parallel lines, pos is set to the zero vector.
a0 | Start of the first line. |
a1 | End of the first line. |
b0 | Start of the second line. |
b1 | End of the second line. |
pos | Set to the intersection position if one exists. |
|
inlinestatic |
Returns the natural (base e) logarithm of a specified number.
|
inlinestatic |
Returns the logarithm of a specified number in a specified base.
|
inlinestatic |
Returns a specified number raised to the specified power.
|
inlinestatic |
Returns a random floating-point number that is greater than or equal to 0.0, and less than 1.0.
|
inlinestatic |
Returns a non-negative random integer that is less than the specified maximum.
|
inlinestatic |
Returns a random integer that is within a specified range.
min | The inclusive lower bound of the random number returned. |
max | The exclusive upper bound of the random number returned. maxValue must be greater than or equal to minValue. |
|
inlinestatic |
Returns a random floating-point number that is greater than or equal to 0.0, and less than max .
max | The exclusive upper bound of the random number returned. maxValue must be greater than or equal to minValue. |
|
inlinestatic |
Returns a random floating-point number that is greater than or equal to min , and less than max .
min | The inclusive lower bound of the random number returned. |
max | The exclusive upper bound of the random number returned. maxValue must be greater than or equal to minValue. |
|
inlinestatic |
Returns a normalized floating-point vector pointing in a uniformly random direction.
|
inlinestatic |
Returns a random floating-point vector with X and Y components in the range [0-1].
|
inlinestatic |
Rounds a single-precision floating-point value to the nearest integral value.
|
inlinestatic |
Rounds a single-precision floating-point value to the nearest integral value.
|
inlinestatic |
Returns the sine of the specified angle.
|
inlinestatic |
Returns the square root of a specified number.
|
inlinestatic |
Returns the tangent of the specified angle.
const float GameAPI.Mathf.PI = (float) Math.PI |
Represents the ratio of the circumference of a circle to its diameter, specified by the constant, π.