C# Class Afterglow.Math.MathExtensions

Contains extension methods.
Show file Open project: Christof/afterglow

Public Methods

Method Description
Clamp ( this value, float min, float max ) : float

Clamps the value to the range given by min and max.

ClampMax ( this value, float max ) : float

Clamps the value to the given maximum.

ClampMin ( this value, float min ) : float

Clamps the value to the given minimum.

EqualsWithDelta ( this value, float other ) : bool

Indicates whether the two floats are equal under the consideration of Constants.DELTA.

EqualsWithDelta ( this value, float other, float delta ) : bool

Indicates whether the two floats are equal under the consideration of the given delta value.

Method Details

Clamp() public static method

Clamps the value to the range given by min and max.
public static Clamp ( this value, float min, float max ) : float
value this The value to be clamped.
min float The min value.
max float The max value.
return float

ClampMax() public static method

Clamps the value to the given maximum.
public static ClampMax ( this value, float max ) : float
value this The value.
max float The maximum.
return float

ClampMin() public static method

Clamps the value to the given minimum.
public static ClampMin ( this value, float min ) : float
value this The value.
min float The minimum.
return float

EqualsWithDelta() public static method

Indicates whether the two floats are equal under the consideration of Constants.DELTA.
public static EqualsWithDelta ( this value, float other ) : bool
value this The value.
other float The other.
return bool

EqualsWithDelta() public static method

Indicates whether the two floats are equal under the consideration of the given delta value.
public static EqualsWithDelta ( this value, float other, float delta ) : bool
value this The value.
other float The other.
delta float The delta.
return bool