Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

VRageMath.MathHelper

Morten Aune Lyrstad edited this page Apr 16, 2022 · 47 revisions

IndexNamespace Index

MathHelper Class

public abstract sealed class MathHelper

Contains commonly used precalculated values.

Namespace: VRageMath
Assembly: VRage.Math.dll

Fields

Member Description
\static float E Represents the mathematical constant e.
\static float EPSILON
\static float EPSILON10
\static float FourPi Represents the value of pi times two.
\static float Log10E Represents the log base ten of e.
\static float Log2E Represents the log base two of e.
\static float Pi Represents the value of pi.
\static float PiOver2 Represents the value of pi divided by two.
\static float PiOver4 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
\static float Sqrt2 Represents the value of the square root of two
\static float Sqrt3 Represents the value of the square root of three
\static float TwoPi Represents the value of pi times two.

Methods

Member Description
\static int Align(int, int)
\static float Atan(float) Faster Atan implementation. Good only in the [-pi/2, pi/2] range.
\static double Atan(double) 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 int CeilToInt(float)
\static int CeilToInt(double)
\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 Floor(float)
\static int Floor(double)
\static int FloorToInt(float)
\static int FloorToInt(double)
\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)
\static bool IsPowerOfTwo(int) Returns true if value is power of two
\static bool IsValid(Matrix)
\static bool IsValid(MatrixD)
\static bool IsValid(Vector3)
\static bool IsValid(Vector3D)
\static bool IsValid(Vector2)
\static bool IsValid(float)
\static bool IsValid(double)
\static bool IsValid(Vector3?)
\static bool IsValid(Quaternion)
\static bool IsValidNormal(Vector3)
\static bool IsValidOrZero(Matrix)
\static bool IsZero(float, \[float])
\static bool IsZero(double, \[float])
\static bool IsZero(Vector3, \[float])
\static bool IsZero(Vector3D, \[float])
\static bool IsZero(Quaternion, \[float])
\static bool IsZero(Vector4)
\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 int Log2(int)
\static int Log2(uint)
\static int Log2Ceiling(int)
\static int Log2Floor(int)
\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 int Max(int, int, int)
\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.
\static int Pow2(int) Returns 2^n
\static float RoundOn2(float)
\static int RoundToInt(float)
\static int RoundToInt(double)
\static float Saturate(float)
\static double Saturate(double)
\static float SCurve3(float)
\static double SCurve3(double)
\static float SCurve5(float)
\static double SCurve5(double)
\static int Smooth(int, int)
\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.
\static float ToDegrees(float) Converts radians to degrees.
\static double ToDegrees(double)
\static float ToRadians(float) Converts degrees to radians.
\static Vector3 ToRadians(Vector3)
\static double ToRadians(double) Converts degrees to radians.
\static float WrapAngle(float) Reduces a given angle to a value between π and -π.
Clone this wiki locally