Class: Vector4d
Methods
Name | Description |
---|---|
:__add(other) | Vector addition by an another vector or number |
:__div(other) | Vector division by an another vector or number |
:__eq(other) | Equality comparison |
:__len() | Number of dimensions/elements in the vector, not the length of the vector |
:__mul(other) | Vector multplication by an another vector or number |
:__sub(other) | Vector subtraction by an another vector or number |
:__tostring() | Format the vector into a human readable string |
:__unm() | Unary minus of the vector |
:length() | Get the length of the vector |
Fields
Name | Type | Description |
---|---|---|
w | number | |
x | number | |
y | number | |
z | number |
Method declarations
Method: __add
Vector addition by an another vector or number
lua
function Vector4d:__add(
other
) end
Parameters:
- other (
number|Vector4d
) - An another vector or number to add
Returns:
- Vector4d - A new vector that is a product of addition
Method: __div
Vector division by an another vector or number
lua
function Vector4d:__div(
other
) end
Parameters:
- other (
number|Vector4d
) - An another vector or number to divide with
Returns:
- Vector4d - A new vector that is a product of division
Method: __eq
Equality comparison
lua
function Vector4d:__eq(
other
) end
Parameters:
- other (Vector4d) - An another vector to compare with
Returns:
boolean
- True if this and the other vector equal
Method: __len
Number of dimensions/elements in the vector, not the length of the vector
lua
function Vector4d:__len() end
Returns:
integer
- The number of dimensions in the vector (i.e. 4)
Method: __mul
Vector multplication by an another vector or number
lua
function Vector4d:__mul(
other
) end
Parameters:
- other (
number|Vector4d
) - An another vector or number to multiply with
Returns:
- Vector4d - A new vector that is a product of multplication
Method: __sub
Vector subtraction by an another vector or number
lua
function Vector4d:__sub(
other
) end
Parameters:
- other (
number|Vector4d
) - An another vector or number to subtract
Returns:
- Vector4d - A new vector that is a product of subtractino
Method: __tostring
Format the vector into a human readable string
lua
function Vector4d:__tostring() end
Returns:
string
- A string representation of this vector
Method: __unm
Unary minus of the vector
lua
function Vector4d:__unm() end
Returns:
- Vector4d - The negative of the current vector
Method: length
Get the length of the vector
lua
function Vector4d:length() end
Returns:
number
- The length of the vector
Field declarations
Field: w
Type: number
Field: x
Type: number
Field: y
Type: number
Field: z
Type: number