Provides math operations not found in System.Math.
Static Public Member Functions | |
static int | ClampValue (int value, int lowerBound, int upperBound) |
Returns the given value clamped between the given lower and upper bounds. More... | |
static double | CubicInterpolate (double n0, double n1, double n2, double n3, double a) |
Returns the cubic interpolation of two values bound between two other values. More... | |
static double | GetSmaller (double a, double b) |
Returns the smaller of the two given numbers. More... | |
static double | GetLarger (double a, double b) |
Returns the larger of the two given numbers. More... | |
static void | SwapValues (ref double a, ref double b) |
Swaps the values contained by the two given variables. More... | |
static double | LinearInterpolate (double n0, double n1, double a) |
Returns the linear interpolation of two values with the given alpha. More... | |
static Color | LinearInterpolate (Color n0, Color n1, float b) |
Returns the linear interpolation of two colours with the given blend. Note that this does not affect the alpha channel. More... | |
static double | SCurve3 (double a) |
Returns the given value, modified to be able to fit into a 32-bit integer. More... | |
static double | SCurve5 (double a) |
Returns the given value mapped onto a quintic S-curve. More... | |
static void | LatLonToXYZ (double lat, double lon, ref double x, ref double y, ref double z) |
Provides the X, Y, and Z coordinates on the surface of a sphere cooresponding to the given latitude and longitude. More... | |
Static Public Attributes | |
static readonly double | PI = 3.1415926535897932385 |
Returns the value of the mathematical constant PI. More... | |
static readonly double | Sqrt2 = 1.4142135623730950488 |
Returns the square root of 2. More... | |
static readonly double | Sqrt3 = 1.7320508075688772935 |
Returns the square root of 3. More... | |
static readonly double | DEG_TO_RAD = PI / 180.0 |
Returns PI/180.0, used for converting degrees to radians. More... | |
|
inlinestatic |
Returns the given value clamped between the given lower and upper bounds.
|
inlinestatic |
Returns the cubic interpolation of two values bound between two other values.
n0 | The value before the first value. |
n1 | The first value. |
n2 | The second value. |
n3 | The value after the second value. |
a | The alpha value. |
|
inlinestatic |
Returns the larger of the two given numbers.
|
inlinestatic |
Returns the smaller of the two given numbers.
|
inlinestatic |
Provides the X, Y, and Z coordinates on the surface of a sphere cooresponding to the given latitude and longitude.
|
inlinestatic |
Returns the linear interpolation of two values with the given alpha.
|
inlinestatic |
Returns the linear interpolation of two colours with the given blend. Note that this does not affect the alpha channel.
|
inlinestatic |
Returns the given value, modified to be able to fit into a 32-bit integer.
Returns the given value mapped onto a cubic S-curve.
|
inlinestatic |
Returns the given value mapped onto a quintic S-curve.
|
inlinestatic |
Swaps the values contained by the two given variables.
|
static |
Returns PI/180.0, used for converting degrees to radians.
|
static |
Returns the value of the mathematical constant PI.
|
static |
Returns the square root of 2.
|
static |
Returns the square root of 3.