Module Core.Common.Vector

Functions

Vector.__add (self, vector) Calculates the sum of two vectors.
Vector.__mul (self, scalar) Multiplies the vector with a scalar.
Vector.__sub (self, vector) Subtracts a vector from another.
Vector.cross (self, vector) Calculates the cross product of two vectors.
Vector.new (clss, args) Creates a new vector.

Tables

Vector Do maths in three dimensions.
Vector.length Length.
Vector.x X value.
Vector.y Y value.
Vector.z Z value.


Functions

Vector.__add (self, vector)
Calculates the sum of two vectors.

Parameters

  • self: Vector.
  • vector: Vector.

Return value:

New vector.
Vector.__mul (self, scalar)
Multiplies the vector with a scalar.

Parameters

  • self: Vector.
  • scalar: Scalar.

Return value:

New vector.
Vector.__sub (self, vector)
Subtracts a vector from another.

Parameters

  • self: Vector.
  • vector: Vector.

Return value:

New vector.
Vector.cross (self, vector)
Calculates the cross product of two vectors.

Parameters

  • self: Vector.
  • vector: Vector.

Return value:

New vector.
Vector.new (clss, args)
Creates a new vector.

Parameters

  • clss: Vector class.
  • args: Arguments.
    • 1,x: X coordinate.
    • 2,y: Y coordinate.
    • 3,z: Z coordinate.

Return value:

New vector.

Tables

Vector
Do maths in three dimensions.
Vector.length
Length.
Vector.x
X value.
Vector.y
Y value.
Vector.z
Z value.

Valid XHTML 1.0!