vec3
math.vec3
Variables
x - number
y - number
z - number
Supported operators:
+, -, /, *
Functions
unpack
local vector = math.vec3(1, 2, 3)local x, y, z = vector:unpack()
Returns:
length
local vector = math.vec3(1, 0, 0)vector:length()
Returns:
length2d
local vector = math.vec3(1, 0, 0)vector:length2d()
Returns:
dist
local vector = math.vec3(1, 0, 0)local vector2 = math.vec3(5, 5, 5)print(vector:dist(vector2))
other vector
math.vec3
vector to calculate distance
Returns:
dist2d
local vector = math.vec3(1, 0, 0)local vector2 = math.vec3(5, 5, 5)print(vector:dist2d(vector2))
other vector
math.vec3
vector to calculate distance
Returns:
to2d
local vector = math.vec3(1, 0, 0)vector:to2d()
Returns:
cross
local vector1 = math.vec3(1, 0, 0)local vector2 = math.vec3(0, 1, 0)local cross_product = vector1:cross(vector2)
other vector
math.vec3
vector to cross with
Returns:
the cross product of the two vectors
math.vec3
normalize
local vector1 = math.vec3(50, 50, 100)local vector_normalized = vector1:normalize()
Returns:
the vector normalized
math.vec3
dot
local vector1 = math.vec3(50, 50, 100)local dot_product = vector1:dot(math.vec3(1, 33, 7))
other vector
math.vec3
vector to calculate dot product with
Returns:
the two vectors dot product
number
calc_angle
local vector1 = math.vec3(50, 50, 100)local vector2 = math.vec3(1, 33, 7)local angle = vector1:calc_angle(vector2)
other vector
math.vec3
vector to calculate angle with
Returns:
Last updated