Packageqnx.fuse.ui.utils
Classpublic final class MathUtils
InheritanceMathUtils Inheritance Object

The MathUtils class contains utility methods for Math related functions.



Public Methods
 MethodDefined By
  
constrain(value:Number, min:Number, max:Number):Number
[static] Constains a number between a minimum and maximum value.
MathUtils
  
map(value:Number, currentMin:Number, currentMax:Number, targetMin:Number, targetMax:Number):Number
[static] Re-maps a value in one range to another.
MathUtils
Method Detail
constrain()method
public static function constrain(value:Number, min:Number, max:Number):Number

Constains a number between a minimum and maximum value.

Parameters

value:Number — The value to constrain.
 
min:Number — The minimum value of the number.
 
max:Number — The maximum value of the number.

Returns
Number
map()method 
public static function map(value:Number, currentMin:Number, currentMax:Number, targetMin:Number, targetMax:Number):Number

Re-maps a value in one range to another.

Parameters

value:Number — The current value to re-map.
 
currentMin:Number — The minimum value in the current range.
 
currentMax:Number — The maximum value in the current range.
 
targetMin:Number — The minimum value in the target range.
 
targetMax:Number — The maximum value in the target range.

Returns
Number — A number bound to the supplied target range.