C# Class Sharpex2D.Math.MathHelper

Mostrar archivo Open project: ThuCommix/Sharpex2D

Public Methods

Method Description
Abs ( float value ) : float

Returns the absolute value.

Atan2 ( float x, float y ) : float

Calculates the arctangent.

Barycentric ( float value1, float value2, float value3, float amount1, float amount2 ) : float

Returns the Cartesian coordinate for one axis of a point that is defined by a given triangle and two normalized barycentric (areal) coordinates.

CatmullRom ( float value1, float value2, float value3, float value4, float amount ) : float

Performs a Catmull-Rom interpolation using the specified positions.

Clamp ( float value, float min, float max ) : float

Restricts a value to be within a specified range.

Cos ( float value ) : float

Returns the cosinus for the specified value.

Distance ( float value1, float value2 ) : float

Calculates the absolute value of the difference of two values.

Hermite ( float value1, float tangent1, float value2, float tangent2, float amount ) : float

Performs a Hermite spline interpolation.

Lerp ( float value1, float value2, float amount ) : float

Linearly interpolates between two values.

Max ( float value1, float value2 ) : float

Returns the greater of two values.

Min ( float value1, float value2 ) : float

Returns the lesser of two values.

Pow ( float basis, float exponent ) : float

Calculates x raised to the power of y.

Round ( float value ) : float

Rounds the specified value.

Sin ( float value ) : float

Returns the sinus for the specified value.

SmoothStep ( float value1, float value2, float amount ) : float

Interpolates between two values using a cubic equation.

Sqrt ( float value ) : float

Returns the square root for the specified value.

ToAngle ( Vector2 vector ) : float

Calculates an angle out of given coordinates.

ToAngle ( float x, float y ) : float

Calculates an angle out of given coordinates.

ToDegrees ( float radians ) : float

Converts radians to degrees.

ToRadians ( float degrees ) : float

Converts degrees to radians.

ToVector ( float angle ) : Vector2

Converts an angle to a direction vector.

WrapAngle ( float angle ) : float

Reduces a given angle to a value between π and -π.

Method Details

Abs() public static method

Returns the absolute value.
public static Abs ( float value ) : float
value float The value.
return float

Atan2() public static method

Calculates the arctangent.
public static Atan2 ( float x, float y ) : float
x float The X.
y float The Y.
return float

Barycentric() public static method

Returns the Cartesian coordinate for one axis of a point that is defined by a given triangle and two normalized barycentric (areal) coordinates.
public static Barycentric ( float value1, float value2, float value3, float amount1, float amount2 ) : float
value1 float The value1.
value2 float The value2.
value3 float The value3.
amount1 float The amount1.
amount2 float The amount2.
return float

CatmullRom() public static method

Performs a Catmull-Rom interpolation using the specified positions.
public static CatmullRom ( float value1, float value2, float value3, float value4, float amount ) : float
value1 float The value1.
value2 float The value2.
value3 float The value3.
value4 float The value4.
amount float The amount.
return float

Clamp() public static method

Restricts a value to be within a specified range.
public static Clamp ( float value, float min, float max ) : float
value float The value.
min float The minimum.
max float The maximum.
return float

Cos() public static method

Returns the cosinus for the specified value.
public static Cos ( float value ) : float
value float The value.
return float

Distance() public static method

Calculates the absolute value of the difference of two values.
public static Distance ( float value1, float value2 ) : float
value1 float The value1.
value2 float The value2.
return float

Hermite() public static method

Performs a Hermite spline interpolation.
public static Hermite ( float value1, float tangent1, float value2, float tangent2, float amount ) : float
value1 float The value1.
tangent1 float The tangent1.
value2 float The value2.
tangent2 float The tangent2.
amount float The amount.
return float

Lerp() public static method

Linearly interpolates between two values.
public static Lerp ( float value1, float value2, float amount ) : float
value1 float The value1.
value2 float The value2.
amount float The amount.
return float

Max() public static method

Returns the greater of two values.
public static Max ( float value1, float value2 ) : float
value1 float The value1.
value2 float The value2.
return float

Min() public static method

Returns the lesser of two values.
public static Min ( float value1, float value2 ) : float
value1 float The value1.
value2 float The value2.
return float

Pow() public static method

Calculates x raised to the power of y.
public static Pow ( float basis, float exponent ) : float
basis float The Basis.
exponent float The Exponent.
return float

Round() public static method

Rounds the specified value.
public static Round ( float value ) : float
value float The value.
return float

Sin() public static method

Returns the sinus for the specified value.
public static Sin ( float value ) : float
value float The value.
return float

SmoothStep() public static method

Interpolates between two values using a cubic equation.
public static SmoothStep ( float value1, float value2, float amount ) : float
value1 float The value1.
value2 float The value2.
amount float The amount.
return float

Sqrt() public static method

Returns the square root for the specified value.
public static Sqrt ( float value ) : float
value float The value.
return float

ToAngle() public static method

Calculates an angle out of given coordinates.
public static ToAngle ( Vector2 vector ) : float
vector Vector2 The vector.
return float

ToAngle() public static method

Calculates an angle out of given coordinates.
public static ToAngle ( float x, float y ) : float
x float The x.
y float The y.
return float

ToDegrees() public static method

Converts radians to degrees.
public static ToDegrees ( float radians ) : float
radians float The radians.
return float

ToRadians() public static method

Converts degrees to radians.
public static ToRadians ( float degrees ) : float
degrees float The degrees.
return float

ToVector() public static method

Converts an angle to a direction vector.
public static ToVector ( float angle ) : Vector2
angle float The angle.
return Vector2

WrapAngle() public static method

Reduces a given angle to a value between π and -π.
public static WrapAngle ( float angle ) : float
angle float The angle.
return float