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

VRageMath.MathHelper

Malware edited this page Dec 25, 2018 · 47 revisions

Index

MathHelper Class

public abstract sealed class MathHelper: object

Contains commonly used precalculated values.

Namespace: VRageMath
Assembly: VRage.Math.dll

Inheritance: object

Example

Remarks

Fields

Member Description
E Represents the mathematical constant e.
Log2E Represents the log base two of e.
Log10E Represents the log base ten of e.
Pi Represents the value of pi.
TwoPi Represents the value of pi times two.
FourPi Represents the value of pi times two.
PiOver2 Represents the value of pi divided by two.
PiOver4 Represents the value of pi divided by four.
Sqrt2 Represents the value of the square root of two
Sqrt3 Represents the value of the square root of three
RadiansPerSecondToRPM 60 / 2*pi
RPMToRadiansPerSecond 2*pi / 60
RPMToRadiansPerMillisec 2*pi / 60000
EPSILON
EPSILON10

Methods

Member Description
ToRadians(float) Converts degrees to radians.
ToRadians(Vector3)
ToRadians(double) Converts degrees to radians.
ToDegrees(float) Converts radians to degrees.
ToDegrees(double)
Distance(float, float) Calculates the absolute value of the difference of two values.
Min(float, float) Returns the lesser of two values.
Max(float, float) Returns the greater of two values.
Min(double, double) Returns the lesser of two values.
Max(double, double) Returns the greater of two values.
Clamp(float, float, float) Restricts a value to be within a specified range. Reference page contains links to related code samples.
Clamp(double, double, double) Restricts a value to be within a specified range. Reference page contains links to related code samples.
Clamp(MyFixedPoint, MyFixedPoint, MyFixedPoint) Restricts a value to be within a specified range. Reference page contains links to related code samples.
Clamp(int, int, int) Restricts a value to be within a specified range. Reference page contains links to related code samples.
Lerp(float, float, float) Linearly interpolates between two values.
Lerp(double, double, double) Linearly interpolates between two values.
InterpLog(float, float, float) Performs interpolation on logarithmic scale.
InterpLogInv(float, float, 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.
SmoothStep(float, float, float) Interpolates between two values using a cubic equation.
SmoothStep(double, double, double) Interpolates between two values using a cubic equation.
SmoothStepStable(float) Interpolates between zero and one using cubic equiation, solved by de Casteljau.
SmoothStepStable(double) Interpolates between zero and one using cubic equiation, solved by de Casteljau.
CatmullRom(float, float, float, float, float) Performs a Catmull-Rom interpolation using the specified positions.
Hermite(float, float, float, float, float) Performs a Hermite spline interpolation.
CalculateBezierPoint(double, Vector3D, Vector3D, Vector3D, Vector3D)
WrapAngle(float) Reduces a given angle to a value between π and -π.
GetNearestBiggerPowerOfTwo(int)
GetNearestBiggerPowerOfTwo(uint)
GetNumberOfMipmaps(int)
GetNearestBiggerPowerOfTwo(float) Returns nearest bigger power of two
GetNearestBiggerPowerOfTwo(double)
Max(float, float, float)
Max(int, int, int)
Min(float, float, float)
Max(double, double, double)
Min(double, double, double)
ComputeHashFromBytes(Byte[])
RoundOn2(float)
IsPowerOfTwo(int) Returns true if value is power of two
SCurve3(float)
SCurve3(double)
SCurve5(float)
SCurve5(double)
Saturate(float)
Saturate(double)
Floor(float)
Floor(double)
Log2Floor(int)
Log2Ceiling(int)
Log2(int)
Log2(uint)
Pow2(int) Returns 2^n
CubicInterp(double, double, double, double, double)
LimitRadians2PI(ref double) Returns angle in range 0..2*PI
LimitRadians(ref float) Returns angle in range 0..2*PI
LimitRadiansPI(ref double) Returns angle in range -PI..PI
LimitRadiansPI(ref float) Returns angle in range -PI..PI
CalculateVectorOnSphere(Vector3, float, 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.
MonotonicAcos(float)
Atan(float) Faster Atan implementation. Good only in the [-pi/2, pi/2] range.
Atan(double) Faster Atan implementation. Good only in the [-pi/2, pi/2] range.
IsEqual(float, float)
IsEqual(Vector2, Vector2)
IsEqual(Vector3, Vector3)
IsEqual(Quaternion, Quaternion)
IsEqual(QuaternionD, QuaternionD)
IsEqual(Matrix, Matrix)
IsValid(Matrix)
IsValid(MatrixD)
IsValid(Vector3)
IsValid(Vector3D)
IsValid(Vector2)
IsValid(float)
IsValid(double)
IsValid(Nullable)
IsValid(Quaternion)
IsValidNormal(Vector3)
IsValidOrZero(Matrix)
IsZero(float, float)
IsZero(double, float)
IsZero(Vector3, float)
IsZero(Vector3D, float)
IsZero(Quaternion, float)
IsZero(Vector4)
Smooth(int, int)
Smooth(float, float)
Clone this wiki locally