MathUtils
Package | qnx.fuse.ui.utils |
Class | public final class MathUtils |
Inheritance | MathUtils ![]() |
The MathUtils class contains utility methods for Math related functions.
Class information: |
---|
PlayBook Tablet OS Version: 1.0.6 |
Public Methods
Method | Defined 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()
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()
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.
|