Hexagon
|
Class for static math operations. More...
Static Public Member Functions | |
static float | SnapNumberToStep (this float number, float step) |
Snaps the given number to the nearest float number within the given step. Rounding for float-point numbers with adjustable accuracy given as the 'step' argument. | |
static Vector2 | GetCirclePointDegrees (float radius, float angle) |
Returns a point on the circumference with the given 'radius' at the given 'angle' in degrees, starting at the point (radius, 0) as in math. | |
static Vector2 | GetCirclePointRadians (float radius, float angle) |
Returns a point on the circumference with the given 'radius' at the given 'angle' in radians, starting at the point (radius, 0) as in math. | |
static int | LeastCommonMultiple (int a, int b) |
Least common multiple of two positive numbers. An exception will be thrown if any of the input numbers are less or equal to zero. | |
static int | LeastCommonMultiple (int[] values) |
Least common multiple of an array of numbers. An exception will be thrown if any of the input numbers are less or equal to zero. Input array may contain any number of elements but it cannot be null. | |
static int | GreatestCommonFactor (int a, int b) |
Greatest common divisor (aka highest common factor) of two numbers. An exception will be thrown if any of the input numbers are less or equal to zero. | |
static int | GreatestCommonFactor (int[] values) |
Greatest common divisor (aka highest common factor) of an array of numbers. An exception will be thrown if any of the input numbers are less or equal to zero. Input array may contain any number of elements but it cannot be null. | |
static int | Ternarsign (float value) |
Returns -1 if 'value' is negative, 0 if 'value' is 0, 1 if 'value' is positive. | |
static float | Ramp (float value, float slideThreshold, float holdValue) |
Holds the input 'value' at 'holdValue' when it is larger than 'slideThreshold', otherwise starts decreasing starting from 'holdValue'. | |
static float | ClampMin (this float value, float min) |
Deprecated. Use Mathf.Max instead. Returns a value in range of [min, +INF). If input value is smaller or equal to 'min' the output will be 'min', otherwise 'value'. | |
static float | ClampMin (this int value, int min) |
Deprecated. Use Mathf.Max instead. Returns a value in range of [min, +INF). If input value is smaller or equal to 'min' the output will be 'min', otherwise 'value'. | |
static float | ClampMax (this float value, float max) |
Deprecated. Use Mathf.Min instead. Returns a value in range of (-INF; max]. If input value is larger or equal to 'max' the output will be 'max', otherwise 'value'. | |
static float | ClampMax (this int value, int max) |
Deprecated. Use Mathf.Min instead. Returns a value in range of (-INF; max]. If input value is larger or equal to 'max' the output will be 'max', otherwise 'value'. | |
static bool | NearlyEqualsPositive (this float a, float b, double epsilon=1E-5) |
Returns true if (a - b) no larger than epsilon, does not check signs of numbers! | |
static bool | NearlyEquals (this float a, float b, double epsilon=1E-5) |
Returns true if |a - b| no larger than epsilon, works on any numbers. | |
static float | Remap (this float value, float minFrom, float maxFrom, float minTo, float maxTo) |
Remaps value from one range to another. It returns a point that lies on the same relative position on the output range as on the input range. | |
Static Public Attributes | |
const float | SQRT_2 = 1.4142136F |
const float | HALF_SQRT_2 = SQRT_2 / 2.0F |
const float | SQRT_3 = 1.7320508F |
const float | TWO_PI = Mathf.PI * 2.0f |
const float | HALF_PI = Mathf.PI / 2.0F |
const float | QUARTER_PI = Mathf.PI / 4.0F |
Class for static math operations.
|
inlinestatic |
Deprecated. Use Mathf.Min instead. Returns a value in range of (-INF; max]. If input value is larger or equal to 'max' the output will be 'max', otherwise 'value'.
|
inlinestatic |
Deprecated. Use Mathf.Min instead. Returns a value in range of (-INF; max]. If input value is larger or equal to 'max' the output will be 'max', otherwise 'value'.
|
inlinestatic |
Deprecated. Use Mathf.Max instead. Returns a value in range of [min, +INF). If input value is smaller or equal to 'min' the output will be 'min', otherwise 'value'.
|
inlinestatic |
Deprecated. Use Mathf.Max instead. Returns a value in range of [min, +INF). If input value is smaller or equal to 'min' the output will be 'min', otherwise 'value'.
|
inlinestatic |
Returns a point on the circumference with the given 'radius' at the given 'angle' in degrees, starting at the point (radius, 0) as in math.
|
inlinestatic |
Returns a point on the circumference with the given 'radius' at the given 'angle' in radians, starting at the point (radius, 0) as in math.
|
inlinestatic |
Greatest common divisor (aka highest common factor) of two numbers. An exception will be thrown if any of the input numbers are less or equal to zero.
|
inlinestatic |
Greatest common divisor (aka highest common factor) of an array of numbers. An exception will be thrown if any of the input numbers are less or equal to zero. Input array may contain any number of elements but it cannot be null.
|
inlinestatic |
Least common multiple of two positive numbers. An exception will be thrown if any of the input numbers are less or equal to zero.
|
inlinestatic |
Least common multiple of an array of numbers. An exception will be thrown if any of the input numbers are less or equal to zero. Input array may contain any number of elements but it cannot be null.
|
inlinestatic |
Returns true if |a - b| no larger than epsilon, works on any numbers.
|
inlinestatic |
Returns true if (a - b) no larger than epsilon, does not check signs of numbers!
|
inlinestatic |
Holds the input 'value' at 'holdValue' when it is larger than 'slideThreshold', otherwise starts decreasing starting from 'holdValue'.
|
inlinestatic |
Remaps value from one range to another. It returns a point that lies on the same relative position on the output range as on the input range.
value | Value to remap |
minFrom | Minimum value of the input range |
maxFrom | Maximum value of the input range |
minTo | Minimum value of the output range |
maxTo | Maximum value of the output range |
|
inlinestatic |
Snaps the given number to the nearest float number within the given step. Rounding for float-point numbers with adjustable accuracy given as the 'step' argument.
number | Number to be rounded |
step | Accuracy of rounding, modulo of the maximum difference with the original 'number' |
|
inlinestatic |
Returns -1 if 'value' is negative, 0 if 'value' is 0, 1 if 'value' is positive.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |