Class MathUtils
Provides methods for miscellaneous mathematical operations.
Inherited Members
Namespace: Mechatronics.SensorSDK
Assembly: solution.dll
Syntax
public static class MathUtils
Fields
Name | Description |
---|---|
Epsilon | The default absolute tolerance for equality comparisons. |
EpsilonSquared | The default absolute tolerance for equality comparisons, squared. |
Methods
Name | Description |
---|---|
AreApproxEqual(float, float, float) | Checks if the magnitude of the difference between the given two floats is almost zero, using an absolute tolerance. |
AreApproxEqual(Vector2, Vector2, float) | Checks if the magnitude of the difference between the given two 2D vectors is almost zero, using an absolute tolerance. |
AreApproxEqual(Vector3, Vector3, float) | Checks if the magnitude of the difference between the given two 3D vectors is almost zero, using an absolute tolerance. |
AreApproxEqual(Vector4, Vector4, float) | Checks if the magnitude of the difference between the given two 4D vectors is almost zero, using an absolute tolerance. |
BuildCountingSequence(double, int) | Get an enumerable of size count, spaced by an interval of delta. |
Cross(Vector2, Vector2) | Computes the cross product of two 2D vectors as |
FModWrap(double, double) | FMod different from a % b in that it will return b + a % b if a is less than 0. Useful for indexing. Assuming a strictly positive b, returned value is always in [0, b). |
FModWrap(float, float) | FMod different from a % b in that it will return b + a % b if a is less than 0. Useful for indexing. Assuming a strictly positive b, returned value is always in [0, b). |
IsApproxZero(float, float) | Checks if the given float is almost zero, using an absolute tolerance. |
IsApproxZero(Vector2, float) | Checks if the magnitude of the given 2D vector is almost zero, using an absolute tolerance. |
IsApproxZero(Vector3, float) | Checks if the magnitude of the given 3D vector is almost zero, using an absolute tolerance. |
IsApproxZero(Vector4, float) | Checks if the magnitude of the given 4D vector is almost zero, using an absolute tolerance. |
IsPowerOf2(int) | Checks if the number is a power of two. |
IsPowerOf2(uint) | Checks if the number is a power of two. |
PowerOf2Ceil(int) | Rounds a number to the next closest power of 2. |
PowerOf2Ceil(uint) | Rounds a number to the next closest power of 2. |
SphericalToCartesian(float, float, float) | Converts spherical coordinates to cartesian coordinates. |
Square(int) | Computes the square of an integer. |
Square(float) | Computes the square of a float. |
Swap<T>(ref T, ref T) | Swaps the values of the given arguments. |
ToQuaternion(Vector4) | Converts a Vector4 into a Quaternion. Member-wise copy. |
ToVector4(Quaternion) | Converts a Quaternion into a Vector4. Member-wise copy. |