Vector.angle
From GiderosMobile
Available since: Gideros 2026.1
Class: vector library
Description
Computes the angle between two vectors in radians.
(number) = vector.angle(vec1,vec2[,axis])
The axis, if specified, is used to determine the sign of the angle.
Parameters
vec1: (vector) the first vector
vec2: (vector) the second vector
axis: (vector) to determine the sign of the angle Optional
Return values
Returns (number) returns the 3-dimensional angle in radians
Example
local vec1 : vector = vector.create(1, 2, 3)
local vec2 : vector = vector.create(3, 2, 1)
local ang = vector.angle(vec1, vec2, vec1)
print(typeof(ang), ang) -- number 0.7751933915024549