Would you like to tell us how we are doing?

You bet No thanks
qnx.fuse.ui.utils.MathUtils

MathUtils

Methods


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

The MathUtils class contains utility methods for Math related functions.

Class information:
BlackBerry 10 Version:   10.0.0



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()


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 — The constrained value.

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.