math Class
Math functions, used within BIMSURFER, but also available for you to use in your application code.
Item Index
Methods
Methods
addVec3
-
u
-
v
-
[dest]
Adds one three-element vector to another.
Parameters:
-
u
Array(Number)First vector
-
v
Array(Number)Second vector
-
[dest]
Array(Number) optionalDestination vector
Returns:
dest if specified, u otherwise
addVec4
-
u
-
v
-
[dest]
Adds one four-element vector to another.
Parameters:
-
u
Array(Number)First vector
-
v
Array(Number)Second vector
-
[dest]
Array(Number) optionalDestination vector
Returns:
dest if specified, u otherwise
addVec4Scalar
-
v
-
s
-
[dest]
Adds a scalar value to each element of a four-element vector.
Parameters:
-
v
Array(Number)The vector
-
s
NumberThe scalar
-
[dest]
Array(Number) optionalDestination vector
Returns:
dest if specified, v otherwise
addVec4Scalar
-
v
-
s
-
[dest]
Adds a scalar value to each element of a three-element vector.
Parameters:
-
v
Array(Number)The vector
-
s
NumberThe scalar
-
[dest]
Array(Number) optionalDestination vector
Returns:
dest if specified, v otherwise
createUUID
()
static
Returns a new UUID.
Returns:
string The new UUID
divVec3
-
u
-
v
-
[dest]
Divides one three-element vector by another.
Parameters:
-
u
Array(Number)First vector
-
v
Array(Number)Second vector
-
[dest]
Array(Number) optionalDestination vector
Returns:
dest if specified, u otherwise
divVec4
-
u
-
v
-
[dest]
Divides one four-element vector by another.
Parameters:
-
u
Array(Number)First vector
-
v
Array(Number)Second vector
-
[dest]
Array(Number) optionalDestination vector
Returns:
dest if specified, u otherwise
mulVec2Scalar
-
v
-
s
-
[dest]
Multiplies each element of a two-element vector by a scalar.
Parameters:
-
v
Array(Number)The vector
-
s
NumberThe scalar
-
[dest]
Array(Number) optionalDestination vector
Returns:
dest if specified, v otherwise
mulVec3
-
u
-
v
-
[dest]
Multiplies one three-element vector by another.
Parameters:
-
u
Array(Number)First vector
-
v
Array(Number)Second vector
-
[dest]
Array(Number) optionalDestination vector
Returns:
dest if specified, u otherwise
mulVec34calar
-
v
-
s
-
[dest]
Multiplies each element of a four-element vector by a scalar.
Parameters:
-
v
Array(Number)The vector
-
s
NumberThe scalar
-
[dest]
Array(Number) optionalDestination vector
Returns:
dest if specified, v otherwise
mulVec3Scalar
-
v
-
s
-
[dest]
Multiplies each element of a three-element vector by a scalar.
Parameters:
-
v
Array(Number)The vector
-
s
NumberThe scalar
-
[dest]
Array(Number) optionalDestination vector
Returns:
dest if specified, v otherwise
negateVec4
-
v
-
[dest]
Negates a four-element vector.
Parameters:
-
v
Array(Number)Vector to negate
-
[dest]
Array(Number) optionalDestination vector
Returns:
dest if specified, v otherwise
subScalarVec4
-
v
-
s
-
[dest]
Sets each element of a 4-element vector to a scalar value minus the value of that element.
Parameters:
-
v
Array(Number)The vector
-
s
NumberThe scalar
-
[dest]
Array(Number) optionalDestination vector
Returns:
dest if specified, v otherwise
subVec2
-
u
-
v
-
[dest]
Subtracts one two-element vector from another.
Parameters:
-
u
Array(Number)First vector
-
v
Array(Number)Vector to subtract
-
[dest]
Array(Number) optionalDestination vector
Returns:
dest if specified, u otherwise
subVec3
-
u
-
v
-
[dest]
Subtracts one three-element vector from another.
Parameters:
-
u
Array(Number)First vector
-
v
Array(Number)Vector to subtract
-
[dest]
Array(Number) optionalDestination vector
Returns:
dest if specified, u otherwise
subVec4
-
u
-
v
-
[dest]
Subtracts one four-element vector from another.
Parameters:
-
u
Array(Number)First vector
-
v
Array(Number)Vector to subtract
-
[dest]
Array(Number) optionalDestination vector
Returns:
dest if specified, u otherwise
subVec4Scalar
-
v
-
s
-
[dest]
Subtracts a scalar value from each element of a four-element vector.
Parameters:
-
v
Array(Number)The vector
-
s
NumberThe scalar
-
[dest]
Array(Number) optionalDestination vector
Returns:
dest if specified, v otherwise