C# Class GameMath.MathF

Datei anzeigen Open project: npruehs/game-math Class Usage Examples

Public Methods

Method Description
Equals ( float x, float y ) : bool

Checks whether the two passed numbers are equal, with respect to possible loss of precision caused by rounding values.

Exp ( float x ) : float

Raises e to the specified power.

Lerp ( float x, float y, float l ) : float

Linearly interpolates between the two passed values.

Log ( float x ) : float

Returns the natural (base e) logarithm of the specified number.

Log10 ( float x ) : float

Returns the base 10 logarithm of the specified number.

Pow ( float x, float y ) : float

Returns the passed number raised to the specified power.

Sqrt ( float x ) : float

Returns the square root of the specified number.

Method Details

Equals() public static method

Checks whether the two passed numbers are equal, with respect to possible loss of precision caused by rounding values.
public static Equals ( float x, float y ) : bool
x float /// First number to compare. ///
y float /// Second number to compare. ///
return bool

Exp() public static method

Raises e to the specified power.
public static Exp ( float x ) : float
x float Power to raise e to.
return float

Lerp() public static method

Linearly interpolates between the two passed values.
public static Lerp ( float x, float y, float l ) : float
x float /// First value to interpolate. ///
y float /// Second value to interpolate. ///
l float /// Interpolation parameter. 0 returns , 1 returns . ///
return float

Log() public static method

Returns the natural (base e) logarithm of the specified number.
public static Log ( float x ) : float
x float Number of get the natural logarithm of.
return float

Log10() public static method

Returns the base 10 logarithm of the specified number.
public static Log10 ( float x ) : float
x float Number to get the base 10 logarithm of.
return float

Pow() public static method

Returns the passed number raised to the specified power.
public static Pow ( float x, float y ) : float
x float Number to compute the power of.
y float Exponent.
return float

Sqrt() public static method

Returns the square root of the specified number.
public static Sqrt ( float x ) : float
x float /// Number to get the square root of. ///
return float