Namespace SpiderGL.Math
The SpiderGL.Math namespace.
- Defined in: math.js
Constructor Attributes | Constructor Name and Description |
---|---|
The SpiderGL.Math namespace.
|
Field Attributes | Field Name and Description |
---|---|
<static> <constant> |
SpiderGL.Math.DEG_TO_RAD
Scale factor for degrees to radians conversion.
|
<static> <constant> |
SpiderGL.Math.E
Alias for Math.E.
|
<static> <constant> |
SpiderGL.Math.INFINITY
Alias for global Infinity.
|
<static> <constant> |
SpiderGL.Math.LN10
Alias for Math.LN10.
|
<static> <constant> |
SpiderGL.Math.LN2
Alias for Math.LN2.
|
<static> <constant> |
SpiderGL.Math.LOG10E
Alias for Math.LOG10E.
|
<static> <constant> |
SpiderGL.Math.LOG2E
Alias for Math.LOG2E.
|
<static> <constant> |
SpiderGL.Math.MAX_NUMBER
Alias for SpiderGL.Math.MAX_VALUE.
|
<static> <constant> |
SpiderGL.Math.MAX_VALUE
Alias for Number.MAX_VALUE.
|
<static> <constant> |
SpiderGL.Math.MIN_NUMBER
Alias for -SpiderGL.Math.MAX_VALUE.
|
<static> <constant> |
SpiderGL.Math.MIN_VALUE
Alias for Number.MIN_VALUE.
|
<static> <constant> |
SpiderGL.Math.NAN
Alias for Number.NaN.
|
<static> <constant> |
SpiderGL.Math.PI
Alias for Math.PI.
|
<static> <constant> |
SpiderGL.Math.RAD_TO_DEG
Scale factor for radians to degrees conversion.
|
<static> <constant> |
SpiderGL.Math.SQRT2
Alias for Math.SQRT2.
|
Method Summary
Method Attributes | Method Name and Description |
---|---|
<static> |
SpiderGL.Math.abs(x)
Alias for Math.abs.
|
<static> |
SpiderGL.Math.acos(x)
Alias for Math.acos.
|
<static> |
SpiderGL.Math.asin(x)
Alias for Math.asin.
|
<static> |
SpiderGL.Math.atan(x)
Alias for Math.atan2.
|
<static> |
SpiderGL.Math.atan2(y, x)
Alias for Math.atan2.
|
<static> |
SpiderGL.Math.ceil(x)
Alias for Math.ceil.
|
<static> |
SpiderGL.Math.clamp(x, min, max)
Clamps a number over a range.
|
<static> |
SpiderGL.Math.cos(x)
Alias for Math.cos.
|
<static> |
SpiderGL.Math.degToRad(x)
Converts degrees to radians.
|
<static> |
SpiderGL.Math.exp(x)
Alias for Math.exp.
|
<static> |
SpiderGL.Math.floor(x)
Alias for Math.floor.
|
<static> |
SpiderGL.Math.lerp(x, y, t)
Linear interpolation between two numbers.
|
<static> |
SpiderGL.Math.ln(x)
Alias for Math.log.
|
<static> |
SpiderGL.Math.log(x)
Alias for Math.log.
|
<static> |
SpiderGL.Math.log10(x)
Logarithm base 10.
|
<static> |
SpiderGL.Math.log2(x)
Logarithm base 2.
|
<static> |
SpiderGL.Math.max(args)
Alias for Math.max.
|
<static> |
SpiderGL.Math.min(args)
Alias for Math.min.
|
<static> |
SpiderGL.Math.pow(x, x)
Alias for Math.pow.
|
<static> |
SpiderGL.Math.project(xyzw, modelViewProjectionMatrix, viewport, depthRange)
|
<static> |
SpiderGL.Math.radToDeg(x)
Converts radians to degrees.
|
<static> |
SpiderGL.Math.random()
Alias for Math.random.
|
<static> |
SpiderGL.Math.random01()
Alias for SpiderGL.Math.random.
|
<static> |
SpiderGL.Math.random11()
Generates a random number between -1.0 and 1.0.
|
<static> |
SpiderGL.Math.randomRange(min, max)
Generates a random number between a and b.
|
<static> |
SpiderGL.Math.round(x)
Alias for Math.round.
|
<static> |
SpiderGL.Math.sin(x)
Alias for Math.sin.
|
<static> |
SpiderGL.Math.sqrt(x)
Alias for Math.sqrt.
|
<static> |
SpiderGL.Math.tan(x)
Alias for Math.tan.
|
<static> |
SpiderGL.Math.unproject(xyz, modelViewProjectionMatrixInverse, viewport, depthRange)
|
Namespace Detail
SpiderGL.Math
The SpiderGL.Math namespace.
Field Detail
<static> <constant>
{number}
SpiderGL.Math.DEG_TO_RAD
Scale factor for degrees to radians conversion.
It is equal to PI / 180.
<static> <constant>
{number}
SpiderGL.Math.E
Alias for Math.E.
<static> <constant>
{number}
SpiderGL.Math.INFINITY
Alias for global Infinity.
<static> <constant>
{number}
SpiderGL.Math.LN10
Alias for Math.LN10.
<static> <constant>
{number}
SpiderGL.Math.LN2
Alias for Math.LN2.
<static> <constant>
{number}
SpiderGL.Math.LOG10E
Alias for Math.LOG10E.
<static> <constant>
{number}
SpiderGL.Math.LOG2E
Alias for Math.LOG2E.
<static> <constant>
{number}
SpiderGL.Math.MAX_NUMBER
Alias for SpiderGL.Math.MAX_VALUE.
<static> <constant>
{number}
SpiderGL.Math.MAX_VALUE
Alias for Number.MAX_VALUE.
<static> <constant>
{number}
SpiderGL.Math.MIN_NUMBER
Alias for -SpiderGL.Math.MAX_VALUE.
<static> <constant>
{number}
SpiderGL.Math.MIN_VALUE
Alias for Number.MIN_VALUE.
<static> <constant>
{number}
SpiderGL.Math.NAN
Alias for Number.NaN.
<static> <constant>
{number}
SpiderGL.Math.PI
Alias for Math.PI.
<static> <constant>
{number}
SpiderGL.Math.RAD_TO_DEG
Scale factor for radians to degrees conversion.
It is equal to 180 / PI.
<static> <constant>
{number}
SpiderGL.Math.SQRT2
Alias for Math.SQRT2.
Method Detail
-
<static> {number} SpiderGL.Math.abs(x)Alias for Math.abs.
- Parameters:
- {number} x
- A number.
- Returns:
- {number} The absolute value of x.
-
<static> {number} SpiderGL.Math.acos(x)Alias for Math.acos.
- Parameters:
- {number} x
- The input cosine.
- Returns:
- {number} The arccosine of x, in radians.
-
<static> {number} SpiderGL.Math.asin(x)Alias for Math.asin.
- Parameters:
- {number} x
- The input sine.
- Returns:
- {number} The arcsine of x, in radians.
-
<static> {number} SpiderGL.Math.atan(x)Alias for Math.atan2.
- Parameters:
- {number} x
- The input number.
- Returns:
- {number} The arctangent of x as a numeric value between -PI/2 and PI/2 radians.
-
<static> {number} SpiderGL.Math.atan2(y, x)Alias for Math.atan2.
- Parameters:
- {number} y
- A number.
- {number} x
- A number.
- Returns:
- {number} The the arctangent of the quotient of its arguments as a numeric value between PI and -PI.
-
<static> {number} SpiderGL.Math.ceil(x)Alias for Math.ceil.
- Parameters:
- {number} x
- The input number.
- Returns:
- {number} x rounded upwards to the nearest integer.
-
<static> {number} SpiderGL.Math.clamp(x, min, max)Clamps a number over a range.
- Parameters:
- {number} x
- The number to clamp.
- {number} min
- The lower bound.
- {number} max
- The upper bound.
- Returns:
- {number} min if x < min, max if x > max, x otherwise.
-
<static> {number} SpiderGL.Math.cos(x)Alias for Math.cos.
- Parameters:
- {number} x
- The input angle, in radians.
- Returns:
- {number} The cosine of x.
-
<static> {number} SpiderGL.Math.degToRad(x)Converts degrees to radians.
- Parameters:
- {number} x
- The input angle, in degrees.
- Returns:
- {number} x in radians.
-
<static> {number} SpiderGL.Math.exp(x)Alias for Math.exp.
- Parameters:
- {number} x
- The input number.
- Returns:
- {number} E raised to x.
-
<static> {number} SpiderGL.Math.floor(x)Alias for Math.floor.
- Parameters:
- {number} x
- The input number.
- Returns:
- {number} x rounded downwards to the nearest integer.
-
<static> {number} SpiderGL.Math.lerp(x, y, t)Linear interpolation between two numbers.
- Parameters:
- {number} x
- The start interpolation bound.
- {number} y
- The stop interpolation bound.
- {number} t
- The interpolation factor, between 0 and 1..
- Returns:
- {number} The interpolated value (1-t)*x + t*y.
-
<static> {number} SpiderGL.Math.ln(x)Alias for Math.log. Same as SpiderGL.Math.log.
- Parameters:
- {number} x
- The input number.
- Returns:
- {number} The natural logarithm (base E) of x.
-
<static> {number} SpiderGL.Math.log(x)Alias for Math.log.
- Parameters:
- {number} x
- The input number.
- Returns:
- {number} The natural logarithm (base E) of x.
-
<static> {number} SpiderGL.Math.log10(x)Logarithm base 10.
- Parameters:
- {number} x
- The input number.
- Returns:
- {number} The base 10 logarithm of x.
-
<static> {number} SpiderGL.Math.log2(x)Logarithm base 2.
- Parameters:
- {number} x
- The input number.
- Returns:
- {number} The base 2 logarithm of x.
-
<static> {number} SpiderGL.Math.max(args)Alias for Math.max.
var x = SpiderGL.Math.max(3, 1.56, 2.1); // x == 3
- Parameters:
- {number} args
- Variable number of arguments
- Returns:
- {number} The number with the highest value.
-
<static> {number} SpiderGL.Math.min(args)Alias for Math.min.
var x = SpiderGL.Math.min(3, 1.56, 2.1); // x == 1.56
- Parameters:
- {number} args
- Variable number of arguments
- Returns:
- {number} The number with the lowest value.
-
<static> {number} SpiderGL.Math.pow(x, x)Alias for Math.pow.
- Parameters:
- {number} x
- The base number.
- {number} x
- The exponent number.
- Returns:
- {number} The value of x to the power of y.
-
<static> SpiderGL.Math.project(xyzw, modelViewProjectionMatrix, viewport, depthRange)
- Parameters:
- xyzw
- modelViewProjectionMatrix
- viewport
- depthRange
-
<static> {number} SpiderGL.Math.radToDeg(x)Converts radians to degrees.
- Parameters:
- {number} x
- The input angle, in radians.
- Returns:
- {number} x in degrees.
-
<static> {number} SpiderGL.Math.random()Alias for Math.random.
- Returns:
- {number} A random number between 0.0 and 1.0, inclusive.
-
<static> {number} SpiderGL.Math.random01()Alias for SpiderGL.Math.random.
- Returns:
- {number} A random number between 0.0 and 1.0, inclusive.
-
<static> {number} SpiderGL.Math.random11()Generates a random number between -1.0 and 1.0.
- Returns:
- {number} A random number between -1.0 and 1.0, inclusive.
-
<static> {number} SpiderGL.Math.randomRange(min, max)Generates a random number between a and b.
- Parameters:
- {number} min
- The range low end-point.
- {number} max
- The range high end-point.
- Returns:
- {number} A random number between min and max, inclusive.
-
<static> {number} SpiderGL.Math.round(x)Alias for Math.round.
var a = SpiderGL.Math.round( 3); // a == 3 var b = SpiderGL.Math.round( -4); // b == -4 var c = SpiderGL.Math.round( 7.21); // c == 7 var d = SpiderGL.Math.round( 7.56); // d == 8 var e = SpiderGL.Math.round(-7.56); // e == -8 var f = SpiderGL.Math.round(-7.21); // f == -7
- Parameters:
- {number} x
- The input number.
- Returns:
- {number} x rounded to the nearest integer.
-
<static> {number} SpiderGL.Math.sin(x)Alias for Math.sin.
- Parameters:
- {number} x
- The input angle, in radians.
- Returns:
- {number} The sine of x.
-
<static> {number} SpiderGL.Math.sqrt(x)Alias for Math.sqrt.
- Parameters:
- {number} x
- The input number.
- Returns:
- {number} The square root of x.
-
<static> {number} SpiderGL.Math.tan(x)Alias for Math.tan.
- Parameters:
- {number} x
- The input angle, in radians.
- Returns:
- {number} The tangent of x.
-
<static> SpiderGL.Math.unproject(xyz, modelViewProjectionMatrixInverse, viewport, depthRange)
- Parameters:
- xyz
- modelViewProjectionMatrixInverse
- viewport
- depthRange