C# Class WinRTXamlToolkit.Tools.MathEx

Extension methods that help simplify some math operations.
Show file Open project: xyzzer/WinRTXamlToolkit

Public Methods

Method Description
Clamp ( this @value, double min, double max ) : double

Returns the value limited by the range of min..max.

If either min or max are double.NaN - they are not limiting the range.

Distance ( this lv, double rv ) : double

Returns the distance between this and right value.

Lerp ( double start, double end, double progress ) : double

Returns linear interpolation between start and end values at position specified as 0..1 range value.

Max ( this lv, double rv ) : double

Returns the maximum of this and right value.

Min ( this lv, double rv ) : double

Returns the minimum of this and right value.

Method Details

Clamp() public static method

Returns the value limited by the range of min..max.
If either min or max are double.NaN - they are not limiting the range.
public static Clamp ( this @value, double min, double max ) : double
@value this
min double The range minimum.
max double The range maximum.
return double

Distance() public static method

Returns the distance between this and right value.
public static Distance ( this lv, double rv ) : double
lv this The left value.
rv double The right value.
return double

Lerp() public static method

Returns linear interpolation between start and end values at position specified as 0..1 range value.
public static Lerp ( double start, double end, double progress ) : double
start double The start value.
end double The end value.
progress double The progress between start and end values /// where for progress value of 0 - the start value is returned and for 1 - the right value is returned.
return double

Max() public static method

Returns the maximum of this and right value.
public static Max ( this lv, double rv ) : double
lv this The left value.
rv double The right value.
return double

Min() public static method

Returns the minimum of this and right value.
public static Min ( this lv, double rv ) : double
lv this The left value.
rv double The right value.
return double