Docs for Version: 1.0a
Show:
Module: Math

Vector class

Constructor

Vector

(
  • x
  • y
  • z
)

Parameters:

  • x Float

    X position

  • y Float

    Y position

  • z Float

    Z position

Methods

add

(
  • v
)
Vector

Add vector

Parameters:

Returns:

Vector:

sum of two vectors

cross

(
  • v
)
Vector

Cross product

Parameters:

Returns:

Vector:

Cross product of two vectors

divide

(
  • v
)
Vector

Divide vector

Parameters:

Returns:

Vector:

quotient of two vectors

dot

(
  • v
)
Vector

Dot product

Parameters:

Returns:

Vector:

Dot product of two vectors

length

() Float

Returns the length of vector

Returns:

Float:

legth of vector

max

() Float

Returns the maximum value of vector absolute axes

Returns:

Float:

max value of (abs(x),abs(y),abs(z))

max

() Float

Returns the maximum value of vector axes

Returns:

Float:

max value of (x,y,z)

min

() Float

Returns the minimum value of vector axes

Returns:

Float:

min value of (x,y,z)

min

() Float

Returns the minimum value of vector axes

Returns:

Float:

min value of (x,y,z)

multiply

(
  • v
)
Vector

Multiply vector

Parameters:

Returns:

Vector:

product of two vectors

negative

() Vector

Returns the opposite vector

Returns:

Vector:

opposite Vector

normalize

() Vector

Returns the normalized vector

Returns:

Vector:

Vector normalized

subtract

(
  • v
)
Vector

Subtract vector

Parameters:

Returns:

Vector:

difference of two vectors

toArray

() Array3

Returns the array of axes

Returns:

Array3:

Array [x,y,z]

unit

() Vector

Returns the unit

Returns:

Vector:

Vector divided by its length