Bit twiddling hacks for JavaScript.
Author: Mikola Lysenko
Ported from Stanford bit twiddling hack library: http://graphics.stanford.edu/~seander/bithacks.html
Tests whether or not the arguments have approximately the same value by given maxDiff
The first number to test.
The second number to test.
Maximum difference.
True if the numbers are approximately equal, false otherwise.
Clamps a value between a minimum float and maximum float value.
Clamps a value between 0 and 1.
Tests whether or not the arguments have approximately the same value, within an absolute or relative tolerance of glMatrix.EPSILON (an absolute tolerance is used for values less than or equal to 1.0, and a relative tolerance is used for larger values)
The first number to test.
The second number to test.
True if the numbers are approximately equal, false otherwise.
Returns ratio of a value within a given range.
Start value.
End value.
Given value.
The ratio between [from, to].
The interpolation coefficient.
The the next power of two.
Returns time wrapped in ping-pong mode.
Time start at 0.
Time of one cycle.
The time wrapped in the first cycle.
Linear congruential generator using Hull-Dobell Theorem.
The random seed.
The pseudo random.
Returns a floating-point pseudo-random number between min (inclusive) and max (exclusive).
The random number.
Returns a pseudo-random integer between min (inclusive) and max (exclusive).
The random integer.
Returns a floating-point random number between min (inclusive) and max (exclusive).
The random number.
Returns a random integer between min (inclusive) and max (exclusive).
The random integer.
构造与指定矩形相等的矩形。等价于 new Rect(rect)
。
相比较的矩形。
new Rect(rect)
构造具有指定的最小值和尺寸的矩形,等价于new Rect(x, y, width, height)
。
矩形在 x 轴上的最小值。
矩形在 y 轴上的最小值。
矩形的宽度。
矩形的高度。
new Rect(x, y, width, height)
Returns float remainder for t / length.
Time start at 0.
Time of one cycle.
The Time wrapped in the first cycle.
Convert Radian To Degree
Angle in Radian
Convert Degree To Radian
Angle in Degrees
Generated using TypeDoc
数学库