![]() | MathUtils Class |
Namespace: Slash.Math.Utils
The MathUtils type exposes the following members.
Name | Description | |
---|---|---|
![]() ![]() | Abs |
Returns the absolute value of the passed number.
|
![]() ![]() | ACos |
Returns the angle whose cosine is the specified number, in radians.
|
![]() ![]() | ASin |
Returns the angle whose sine is the specified number, in radians.
|
![]() ![]() | ATan |
Returns the angle whose tangent is the specified number, in radians.
|
![]() ![]() | Atan2 |
Returns the angle in radians between the positive x-axis of a plane and the point given by the coordinates (x, y).
|
![]() ![]() | Ceil |
Returns the smallest integral value that is greater than or equal to the specified value.
|
![]() ![]() | CeilToInt |
Converts the specified float value to the ceil value as an integer.
The smallest integer bigger than or equal the specified value is returned.
|
![]() ![]() | ClampT |
Clamps the passed value to the passed bounds (i.e. if value is smaller than min bound it's set to min bound,
if bigger than max bound it's set to max bound).
|
![]() ![]() | Cos |
Returns the cosine of the specified angle in radians.
|
![]() ![]() | Exp |
Returns e raised to the specified power.
|
![]() ![]() | FloatEquals(Single, Single) |
Checks if the passed float values are "equal". I.e. checking if the difference between the two is smaller than the epsilon value specified in MathUtils.Epsilon.
|
![]() ![]() | FloatEquals(Vector2F, Vector2F) |
Checks if the passed vector's components are "equal". I.e. checking if the difference between the components of the two is smaller than the epsilon value specified in MathUtils.Epsilon.
|
![]() ![]() | FloatEquals(Single, Single, Single) |
Checks if a floating point Value is equal to another, within a certain tolerance.
|
![]() ![]() | FloatEquals(Vector2F, Vector2F, Single) |
Checks if the passed vector's components are "equal". I.e. checking if the difference between the components of the two is smaller than the passed delta.
|
![]() ![]() | FloatInRange |
Checks if a floating point Value is within a specified range of values (inclusive).
|
![]() ![]() | Floor |
Rounds the passed float value down.
|
![]() ![]() | FloorToInt |
Converts the specified float value to the floor value as an integer.
The largest integer less than or equal the specified value is returned.
|
![]() ![]() | IsWithinBoundsT |
Checks if the passed value is within the passed bounds (i.e. bigger or equal minimum bound and
smaller maximum bound).
|
![]() ![]() | IsWithinBoundsInclusiveT |
Checks if the specified value is within the specified bounds (i.e. bigger or equal minimum bound and
smaller or equal maximum bound).
|
![]() ![]() | Lerp |
Linear interpolation of a float. TODO: generic
|
![]() ![]() | Log(Single) |
Returns the natural logarithm of the specified number.
|
![]() ![]() | Log(Single, Single) |
Returns the logarithm of the specified number in the passed base.
|
![]() ![]() | Log10 |
Returns the base 10 logarithm of the specified number.
|
![]() ![]() | Log2 |
Returns the base 2 logarithm of the specified number.
|
![]() ![]() | MaxT(T) |
Returns the maximum value of the specified values.
|
![]() ![]() | MaxT(T, T) |
Returns the maximum value of the two passed values.
|
![]() ![]() | MinT(T) |
Returns the minimum value of the specified values.
|
![]() ![]() | MinT(T, T) |
Returns the minimum value of the two passed values.
|
![]() ![]() | Mod |
Returns the remainder of the Euclidean division of a by n.
|
![]() ![]() | Pow(Int32, UInt32) |
Returns the specified number raised to the passed power.
|
![]() ![]() | Pow(Single, Single) |
Returns the specified number raised to the passed power.
|
![]() ![]() | Pow2(Int32) |
Returns the square of the specified number.
|
![]() ![]() | Pow2(Single) |
Returns the square of the specified number.
|
![]() ![]() | Pow3 |
Returns the cube of the specified number.
|
![]() ![]() | Round(Single) |
Rounds the specified number to the nearest integral value.
|
![]() ![]() | Round(Single, Int32) |
Rounds the specified number to the passed number of fractional digits.
|
![]() ![]() | RoundToInt |
Rounds the specified value to the nearest integral value.
|
![]() ![]() | Saturate |
Clamps the passed value to 0...1.
|
![]() ![]() | Sign |
Determines the sign of the passed value. Returns -1 if value is negative, 1 if value is positive, 0 if value is zero.
|
![]() ![]() | Sin |
Returns the sine of the specified angle in radians.
|
![]() ![]() | Sqrt |
Returns the square root of the specified number.
|
![]() ![]() | SwapT |
Swaps the two specified values.
|
![]() ![]() | Tan |
Returns the tangent of the specified angle in radians.
|
![]() ![]() | Wrap |
Wraps value so that it is between 0.0(included) and 1.0(not included). Examples: 1.5 -> 0.5, 1.0 -> 0.0, -0.75 -> 0.25.
|
![]() ![]() | WrapValue |
Wraps a value with a specific base. E.g. 360°
|
Name | Description | |
---|---|---|
![]() ![]() | E |
Euler's number.
|
![]() ![]() | Pi |
Ratio of a circle's circumference to its diameter.
|
![]() ![]() | PiOver2 |
Pi divided by two.
|
![]() ![]() | PiOver4 |
Pi divided by four.
|
![]() ![]() | TwoPi |
Pi multiplied with two.
|