API Docs for: 2.0.0
Show:

math Class

Module: math
Parent Module: BIMSURFER

Math functions, used within BIMSURFER, but also available for you to use in your application code.

Methods

addVec3

(
  • u
  • v
  • [dest]
)
Array(Number)

Adds one three-element vector to another.

Parameters:

  • u Array(Number)

    First vector

  • v Array(Number)

    Second vector

  • [dest] Array(Number) optional

    Destination vector

Returns:

Array(Number):

dest if specified, u otherwise

addVec4

(
  • u
  • v
  • [dest]
)
Array(Number)

Adds one four-element vector to another.

Parameters:

  • u Array(Number)

    First vector

  • v Array(Number)

    Second vector

  • [dest] Array(Number) optional

    Destination vector

Returns:

Array(Number):

dest if specified, u otherwise

addVec4Scalar

(
  • v
  • s
  • [dest]
)
Array(Number)

Adds a scalar value to each element of a four-element vector.

Parameters:

  • v Array(Number)

    The vector

  • s Number

    The scalar

  • [dest] Array(Number) optional

    Destination vector

Returns:

Array(Number):

dest if specified, v otherwise

addVec4Scalar

(
  • v
  • s
  • [dest]
)
Array(Number)

Adds a scalar value to each element of a three-element vector.

Parameters:

  • v Array(Number)

    The vector

  • s Number

    The scalar

  • [dest] Array(Number) optional

    Destination vector

Returns:

Array(Number):

dest if specified, v otherwise

createUUID

() static

Returns a new UUID.

Returns:

string The new UUID

divVec3

(
  • u
  • v
  • [dest]
)
Array(Number) static

Divides one three-element vector by another.

Parameters:

  • u Array(Number)

    First vector

  • v Array(Number)

    Second vector

  • [dest] Array(Number) optional

    Destination vector

Returns:

Array(Number):

dest if specified, u otherwise

divVec4

(
  • u
  • v
  • [dest]
)
Array(Number) static

Divides one four-element vector by another.

Parameters:

  • u Array(Number)

    First vector

  • v Array(Number)

    Second vector

  • [dest] Array(Number) optional

    Destination vector

Returns:

Array(Number):

dest if specified, u otherwise

mulVec2Scalar

(
  • v
  • s
  • [dest]
)
Array(Number)

Multiplies each element of a two-element vector by a scalar.

Parameters:

  • v Array(Number)

    The vector

  • s Number

    The scalar

  • [dest] Array(Number) optional

    Destination vector

Returns:

Array(Number):

dest if specified, v otherwise

mulVec3

(
  • u
  • v
  • [dest]
)
Array(Number)

Multiplies one three-element vector by another.

Parameters:

  • u Array(Number)

    First vector

  • v Array(Number)

    Second vector

  • [dest] Array(Number) optional

    Destination vector

Returns:

Array(Number):

dest if specified, u otherwise

mulVec34calar

(
  • v
  • s
  • [dest]
)
Array(Number)

Multiplies each element of a four-element vector by a scalar.

Parameters:

  • v Array(Number)

    The vector

  • s Number

    The scalar

  • [dest] Array(Number) optional

    Destination vector

Returns:

Array(Number):

dest if specified, v otherwise

mulVec3Scalar

(
  • v
  • s
  • [dest]
)
Array(Number)

Multiplies each element of a three-element vector by a scalar.

Parameters:

  • v Array(Number)

    The vector

  • s Number

    The scalar

  • [dest] Array(Number) optional

    Destination vector

Returns:

Array(Number):

dest if specified, v otherwise

negateVec4

(
  • v
  • [dest]
)
Array(Number)

Negates a four-element vector.

Parameters:

  • v Array(Number)

    Vector to negate

  • [dest] Array(Number) optional

    Destination vector

Returns:

Array(Number):

dest if specified, v otherwise

subScalarVec4

(
  • v
  • s
  • [dest]
)
Array(Number)

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 Number

    The scalar

  • [dest] Array(Number) optional

    Destination vector

Returns:

Array(Number):

dest if specified, v otherwise

subVec2

(
  • u
  • v
  • [dest]
)
Array(Number)

Subtracts one two-element vector from another.

Parameters:

  • u Array(Number)

    First vector

  • v Array(Number)

    Vector to subtract

  • [dest] Array(Number) optional

    Destination vector

Returns:

Array(Number):

dest if specified, u otherwise

subVec3

(
  • u
  • v
  • [dest]
)
Array(Number)

Subtracts one three-element vector from another.

Parameters:

  • u Array(Number)

    First vector

  • v Array(Number)

    Vector to subtract

  • [dest] Array(Number) optional

    Destination vector

Returns:

Array(Number):

dest if specified, u otherwise

subVec4

(
  • u
  • v
  • [dest]
)
Array(Number)

Subtracts one four-element vector from another.

Parameters:

  • u Array(Number)

    First vector

  • v Array(Number)

    Vector to subtract

  • [dest] Array(Number) optional

    Destination vector

Returns:

Array(Number):

dest if specified, u otherwise

subVec4Scalar

(
  • v
  • s
  • [dest]
)
Array(Number)

Subtracts a scalar value from each element of a four-element vector.

Parameters:

  • v Array(Number)

    The vector

  • s Number

    The scalar

  • [dest] Array(Number) optional

    Destination vector

Returns:

Array(Number):

dest if specified, v otherwise