A helper class to do calculations and conversions.
constrain
num
min
max
Defined in
ts/util/MathUtil.ts:17
degreesToRadians
degrees
Defined in
ts/util/MathUtil.ts:175
factorial
num
Defined in
ts/util/MathUtil.ts:323
getDivisors
num
Defined in
ts/util/MathUtil.ts:352
Return an array of divisors of the integer.
num
Number
The number.
isEven
num
Defined in
ts/util/MathUtil.ts:272
isNegative
num
Defined in
ts/util/MathUtil.ts:234
isOdd
num
Defined in
ts/util/MathUtil.ts:252
isPositive
num
Defined in
ts/util/MathUtil.ts:216
isPrime
num
Defined in
ts/util/MathUtil.ts:292
map
num
min1
max1
min2
max2
Defined in
ts/util/MathUtil.ts:120
Re-maps a number from one range to another. The output is the same as inputing the result of rangeToPercent() numbero percentToRange(). Example: num = 10, min1 = 0, max1 = 100, min2 = 0, max2 = 50 // outputs 5
MathUtil.map(10, 0, 100, 0, 50);
// 5
percentToRange
percent
min
max
Defined in
ts/util/MathUtil.ts:101
radiansToDegrees
radians
Defined in
ts/util/MathUtil.ts:156
randomRange
min
max
[wholeNumber=true]
Defined in
ts/util/MathUtil.ts:49
rangeToPercent
num
min
max
constrainMin
constrainMax
Defined in
ts/util/MathUtil.ts:72
Returns the percentage of a number in a given range. Example: num = 15 range 10 to 20 // outputs 0.5
MathUtil.rangeToPercent(15, 10, 20);
// 0.5
sign
num
Defined in
ts/util/MathUtil.ts:194
There are no methods that match your current filter settings. You can change your filter settings in the index section on this page. index