Value.
The hyperbolic arc-cosine for the value.
Returns the angle, in degrees, between two positions.
First point X position.
First point Y position.
Second point X position.
Second point Y position.
The angle between the positions, in degrees.
Returns the difference between two angles, in degrees.
First angle, in degrees.
Second angle, in degrees.
Return the difference of the angles, in degrees.
Hyperbolic arcsine
Value.
The hyperbolic arcsine for the value.
Hyperbolic arctangent
Value.
The hyperbolic arctangent for the value.
Cube root
Value.
Return the cube root for the value.
Rounds up a number to the Nth decimal place
the rounded value
Limit a value to a range.
Value.
The minimum value.
The maximum value.
The new value.
Hyperbolic cosine
Value.
The hyperbolic cosine for the value.
Cotangent
Value.
The cotangent for the value.
Cosecant
Value.
The cosecant for the value.
Returns the distance, in pixels, between two positions.
First point X position.
First point Y position.
Second point X position.
Second point Y position.
The distance between the positions, in pixels.
Return an exponential interpolation between start
and end
.
For instance, exponentialInterpolation(2, 8, 0.5)
is 4
.
Start value.
End value.
The interpolation value between 0 and 1.
The interpolated value.
Rounds down a number to the Nth decimal place
the rounded value
Compute the X position when given an angle and distance relative to the origin (0;0). This is also known as getting the cartesian coordinates of a 2D vector, using its polar coordinates.
The angle, in degrees.
The distance from the object, in pixels.
Compute the Y position when given an angle and distance relative to the origin (0;0). This is also known as getting the cartesian coordinates of a 2D vector, using its polar coordinates.
The angle, in degrees.
The distance from the object, in pixels.
Check if the game runs on a mobile device (iPhone, iPad, Android). Note that the distinction between what is a mobile device and what is not is becoming blurry. If you use this for mobile controls, prefer to check if the device has touchscreen support.
Return a linear interpolation between a and b.
For instance, lerp(2, 8, 0.5)
is 5
.
Start value.
End value.
The interpolation value between 0 and 1.
The interpolated value, now between a and b.
Linearly interpolates between two angles (in degrees) by taking the shortest direction around the circle.
Starting angle, in degrees.
Destination angle, in degrees.
The interpolation value between 0 and 1.
Return the interpolated angle, in degrees.
Base-10 logarithm
Value.
The base-10 logarithm for the value.
Base-2 logarithm
Value.
The base-2 logarithm for the value.
Negate the boolean.
The boolean to negate.
The negated value.
Modulo operation (the remainder after dividing one number by another)
Dividend value.
Divisor value.
Return the remainder for the values.
Normalize a value between min
and max
to a value between 0 and 1.
The value to normalize
The minimum
The maximum
The normalized value between 0 and 1
N-th root
Base value.
Exponent value.
Return the n-th root for the value.
Pi 3.1415...
the Pi number
Rounds a number to the Nth decimal place
the rounded value
Secant
Value.
The secant for the value.
Returns the sign of the number. This checks if the value is positive, negative or zero.
Value.
Return the sign for the value (1, -1 or 0).
Hyperbolic sine
Value.
The hyperbolic sine for the value.
Hyperbolic tangent
Value.
The hyperbolic tangent for the value.
Convert a string to a number.
String to convert.
The parsed number, or NaN if invalid.
Convert a number to a string.
Value to convert to a string.
The value as a string.
Truncate a number.
Value.
Return the value with all decimal places dropped.
Generated using TypeDoc
Hyperbolic arc-cosine