C# Class LostPolygon.DynamicWaterSystem.FastFunctions

A collection of fast implementations of mathematical functions.
Datei anzeigen Open project: caffeinatedguy/Limbs Class Usage Examples

Public Methods

Method Description
FastCos ( float x ) : float

Calculates the approximate value of cosine function at a given angle.

This function is much faster than Mathf.Cos(), especially on mobile devices.

FastInvSqrt ( float x ) : float

Calculates the approximate inverse square root of a given value.

This function is much faster than calling 1/Mathf.Sqrt(x), especially on mobile devices.

FastIsNaN ( float x ) : bool

Checks whether the float value is NaN.

This function is much faster than calling Math.IsNaN(), especially on mobile devices.

FastLog2 ( float x ) : float

Calculates the approximate log2 of a given value.

This function is much faster than Mathf.Log(), especially on mobile devices.

FastPow ( float a, float b ) : float

Calculates the approximate value of a^b.

This function is much faster than Mathf.Pow(), especially on mobile devices.

FastPow2 ( float x ) : float

Calculates the approximate value of 2^x.

This function is much faster than Mathf.Pow(), especially on mobile devices.

FastPowInt ( float a, int b ) : float

Calculates the approximate value of a^b.

This function is much faster than Mathf.Pow(), especially on mobile devices.

FastSin ( float x ) : float

Calculates the approximate value of sine function at a given angle.

This function is much faster than Mathf.Sin(), especially on mobile devices.

FastSqrt ( float x ) : float

Calculates the approximate square root of a given value.

This function is much faster than Mathf.Sqrt(), especially on mobile devices.

FastVector3Magnitude ( Vector3 vector ) : float

Calculates the approximate magnitude of Vector3.

This function is much faster than Vector3.magnitude, especially on mobile devices.

Method Details

FastCos() public static method

Calculates the approximate value of cosine function at a given angle.
This function is much faster than Mathf.Cos(), especially on mobile devices.
public static FastCos ( float x ) : float
x float /// The angle in radians. ///
return float

FastInvSqrt() public static method

Calculates the approximate inverse square root of a given value.
This function is much faster than calling 1/Mathf.Sqrt(x), especially on mobile devices.
public static FastInvSqrt ( float x ) : float
x float /// The input value. ///
return float

FastIsNaN() public static method

Checks whether the float value is NaN.
This function is much faster than calling Math.IsNaN(), especially on mobile devices.
public static FastIsNaN ( float x ) : bool
x float /// The input value to be checked. ///
return bool

FastLog2() public static method

Calculates the approximate log2 of a given value.
This function is much faster than Mathf.Log(), especially on mobile devices.
public static FastLog2 ( float x ) : float
x float /// Input value. ///
return float

FastPow() public static method

Calculates the approximate value of a^b.
This function is much faster than Mathf.Pow(), especially on mobile devices.
public static FastPow ( float a, float b ) : float
a float /// The base value. ///
b float /// The power value. ///
return float

FastPow2() public static method

Calculates the approximate value of 2^x.
This function is much faster than Mathf.Pow(), especially on mobile devices.
public static FastPow2 ( float x ) : float
x float /// Input value. ///
return float

FastPowInt() public static method

Calculates the approximate value of a^b.
This function is much faster than Mathf.Pow(), especially on mobile devices.
public static FastPowInt ( float a, int b ) : float
a float /// The base value. ///
b int /// The power value. ///
return float

FastSin() public static method

Calculates the approximate value of sine function at a given angle.
This function is much faster than Mathf.Sin(), especially on mobile devices.
public static FastSin ( float x ) : float
x float /// The angle in radians. ///
return float

FastSqrt() public static method

Calculates the approximate square root of a given value.
This function is much faster than Mathf.Sqrt(), especially on mobile devices.
public static FastSqrt ( float x ) : float
x float /// Input value. ///
return float

FastVector3Magnitude() public static method

Calculates the approximate magnitude of Vector3.
This function is much faster than Vector3.magnitude, especially on mobile devices.
public static FastVector3Magnitude ( Vector3 vector ) : float
vector UnityEngine.Vector3 /// Input vector. ///
return float