MW UNITY NAMESPACE








































public delegate float

IntegralFunction


Delegate for FIntegral.


public static class

Fast


Fast implementations of common Mathematical functions using Bit Magic.



public static unsafe float

FInverseSqrt (float N, int NewtonIterations)

Summary:

1 / sqrt(N).

Remarks:

Modified from: The 'Quake III Fast Inv. Sqrt Algorithm'

Params:

N:

        1 / sqrt(x) where x is N.

NewtonIterations:

        The number of Newton Iterations to perform. + = Increased accuracy, decreased speed. - = Decreased accuracy, increased speed.

Returns:

An approximation for calculating: 1 / sqrt(N), within +-.00001 of the real inverse square root with 3 Newton Iterations.



public static float

FSqrt (float F, int NewtonIterations)

Summary:

Faster version of Mathf.Sqrt().

NewtonIterations:

        The number of Newton Iterations to perform. + = Increased accuracy, decreased speed. - = Decreased accuracy, increased speed.

Returns:

An approximation for the Square Root of F, within +-.00001 of the real square root with 3 Newton Iterations.



public static unsafe float

FInverse (float N, int NewtonRaphsonIterations)

Summary:

Fast reciprocal/inverse function for any float N. 1f / N.

Params:

N:

        The number to take the inverse of.

NewtonRaphsonIterations:

        The number of Newton Raphson iterations to perform. + = Increased accuracy, decreased speed. - = Decreased accuracy, increased speed.

Returns:

An approximation for calculating: 1 / N, within +-.000008 of the real reciprocal with 5 Newton Raphson iterations.



public static float

FIntegral (float LowerLimit, float UpperLimit, IntegralFunction Func, float Delta)

Summary:

Approximates the integral between LowerLimit and UpperLimit by Delta.

Params:

LowerLimit:

        The lower limit.

UpperLimit:

        The upper limit.

Func:

        The function to pass in.

Delta:

        The delta.

Returns:

An approximation of LowerLimit ∫ UpperLimit Func() Deltax.



public static float

FArcSine (float Angle)

Summary:

Faster version of Mathf.Asin().

Params:

Angle:

        The angle to get the inverse Sine of.

Returns:

Inverse Sine of Angle in radians, accurate to +-.001 radians.



public static float

FArcCosine (float Angle)

Summary:

Faster version of Mathf.Acos().

Params:

Angle:

        The angle to get the inverse Cosine of.

Returns:

Inverse Cosine of Angle in radians, accurate to +-.001 radians.



public static float

FArcTangent (float N)

Summary:

Faster version of Mathf.Atan().

Params:

N:

        The ratio O/A.

Returns:

Inverse Tangent of N in radians, accurate to +-.00136 radians.



public static float

FArcTangent2 (float Y, float X)

Summary:

Faster version of Mathf.Atan2().

Params:

Y:

        The Y component of a point.

X:

        The X component of a point.

Returns:

Approximation of Atan2, accurate to +-.00136 radians.



public static float

FAngle (MVector L, MVector R)

Summary:

Faster version of Vector3.Angle().

Params:

L:

        The Vector in which the angular difference is measured.

R:

        The Vector in which the angular difference is measured.

Returns:

The Angle between L and R in degrees, accurate to +-.1 degrees.



public static int

FAbs (int I)

Summary:

Absolute Value of I.

Params:

I:

        The int to get the Absolute Value of.

Returns:

The value of I regardless of its sign.



public static unsafe float

FAbs (float F)

Summary:

Absolute Value of F.

Params:

F:

        The float to get the Absolute Value of.

Returns:

The value of F regardless of its sign.



public static unsafe float

FAbs (float& F)

Summary:

Absolute Value of F.

Params:

F:

        The float to set the Absolute Value of.

Returns:

The value of F regardless of its sign.