-
Notifications
You must be signed in to change notification settings - Fork 123
VRageMath.MathHelper
← Index ← Namespace Index
public abstract sealed class MathHelperContains commonly used precalculated values.
Namespace: VRageMath
Assembly: VRage.Math.dll
Represents the mathematical constant e.
Represents the value of pi times two.
Represents the log base ten of e.
Represents the log base two of e.
Represents the value of pi.
Represents the value of pi divided by two.
Represents the value of pi divided by four.
static float RadiansPerSecondToRPM
60 / 2*pi
static float RPMToRadiansPerMillisec
2*pi / 60000
static float RPMToRadiansPerSecond
2*pi / 60
Represents the value of the square root of two
Represents the value of the square root of three
Represents the value of pi times two.
Faster Atan implementation. Good only in the [-pi/2, pi/2] range.
Faster Atan implementation. Good only in the [-pi/2, pi/2] range.
static float Barycentric(float, float, float, float, float)
Returns the Cartesian coordinate for one axis of a point that is defined by a given triangle and two normalized barycentric (areal) coordinates.
static Vector3D CalculateBezierPoint(double, Vector3D, Vector3D, Vector3D, Vector3D)
static Vector3 CalculateVectorOnSphere(Vector3, float, float)
static float CatmullRom(float, float, float, float, float)
Performs a Catmull-Rom interpolation using the specified positions.
static float Clamp(float, float, float)
Restricts a value to be within a specified range. Reference page contains links to related code samples.
static double Clamp(double, double, double)
Restricts a value to be within a specified range. Reference page contains links to related code samples.
static MyFixedPoint Clamp(MyFixedPoint, MyFixedPoint, MyFixedPoint)
Restricts a value to be within a specified range. Reference page contains links to related code samples.
static int Clamp(int, int, int)
Restricts a value to be within a specified range. Reference page contains links to related code samples.
static int ComputeHashFromBytes(Byte[])
static double CubicInterp(double, double, double, double, double)
static float Distance(float, float)
Calculates the absolute value of the difference of two values.
static int GetNearestBiggerPowerOfTwo(int)
static uint GetNearestBiggerPowerOfTwo(uint)
static int GetNearestBiggerPowerOfTwo(float)
Returns nearest bigger power of two
static int GetNearestBiggerPowerOfTwo(double)
static int GetNumberOfMipmaps(int)
static float Hermite(float, float, float, float, float)
Performs a Hermite spline interpolation.
static float InterpLog(float, float, float)
Performs interpolation on logarithmic scale.
static float InterpLogInv(float, float, float)
static bool IsEqual(float, float)
static bool IsEqual(Vector2, Vector2)
static bool IsEqual(Vector3, Vector3)
static bool IsEqual(Quaternion, Quaternion)
static bool IsEqual(QuaternionD, QuaternionD)
static bool IsEqual(Matrix, Matrix)
Returns true if value is power of two
static bool IsValid(Quaternion)
static bool IsValidNormal(Vector3)
static bool IsValidOrZero(Matrix)
static bool IsZero(float, float = 1E-05)
static bool IsZero(double, float = 1E-05)
static bool IsZero(Vector3, float = 1E-05)
static bool IsZero(Vector3D, float = 1E-05)
static bool IsZero(Quaternion, float = 1E-05)
static float Lerp(float, float, float)
Linearly interpolates between two values.
static double Lerp(double, double, double)
Linearly interpolates between two values.
static void LimitRadians(ref float)
Returns angle in range 0..2*PI
static void LimitRadians2PI(ref double)
Returns angle in range 0..2*PI
static void LimitRadiansPI(ref double)
Returns angle in range -PI..PI
static void LimitRadiansPI(ref float)
Returns angle in range -PI..PI
static float Max(float, float)
Returns the greater of two values.
static double Max(double, double)
Returns the greater of two values.
static float Max(float, float, float)
static double Max(double, double, double)
static float Min(float, float)
Returns the lesser of two values.
static double Min(double, double)
Returns the lesser of two values.
static float Min(float, float, float)
static double Min(double, double, double)
static float MonotonicAcos(float)
static float MonotonicCosine(float)
Calculate the monotonic cosine of a value. Monotonic cosine is an alternative cosine encoding that is monotonic in the [-pi, pi] interval. We use this when some parameter of an onject in a planet is constrained by latitude. The 'monotonicity' is guaranteed by subtracting the cosine value from 2 if the angle is positive. So for instance MonotonicCos(pi/2) = 2. This only works in the above interval of course.
Returns 2^n
static double Saturate(double)
static float Smooth(float, float)
static float SmoothStep(float, float, float)
Interpolates between two values using a cubic equation.
static double SmoothStep(double, double, double)
Interpolates between two values using a cubic equation.
static float SmoothStepStable(float)
Interpolates between zero and one using cubic equiation, solved by de Casteljau.
static double SmoothStepStable(double)
Interpolates between zero and one using cubic equiation, solved by de Casteljau.
Converts radians to degrees.
static double ToDegrees(double)
Converts degrees to radians.
static Vector3 ToRadians(Vector3)
static double ToRadians(double)
Converts degrees to radians.
Reduces a given angle to a value between π and -π.
Do you have questions, comments, suggestions for improvements? Is there something I can do better? Did I make a mistake? Please add an issue here, and prefix your issue title with Wiki. Thank you, your help will be very appreciated!