vec
Constructs a 2D vector from vec(x, y), or a 3D vector from vec(x, y, z) -- dispatches on argument count.
x(number) --y(number) --z(number) -- optional -- present makes this a 3D vector
Constructs a 2D vector from vec(x, y), or a 3D vector from vec(x, y, z) -- dispatches on argument count.
x (number) -- y (number) -- z (number) -- optional -- present makes this a 3D vectorAdds two vectors of the same dimension (both 2D or both 3D). Also works on complex numbers (complex(3, 4)). Also works on quaternions. Also works on tensors. Also the exact sum of two algebraic numbers.
a (vector) -- b (vector) -- same dimension as aSubtracts b from a, for two vectors of the same dimension. Also works on complex numbers (complex(3, 4)). Also works on quaternions. Also works on tensors.
a (vector) -- b (vector) -- same dimension as aMultiplies a vector by a scalar. Also a number times a quaternion. Also works on tensors.
v (vector) -- s (number) -- scale factorNegates a vector, reversing its direction. Also works on complex numbers (complex(3, 4)). Also works on quaternions. Also works on tensors.
v (vector) -- Scales a vector to unit length, keeping its direction. Also the unit quaternion q/|q|.
v (vector) -- Rotates a 2D vector by an angle, in radians. Has no 3D form -- there is no single axis to rotate around. With a quaternion and a 3D vector: the vector rotated by q.
v (vector2) -- theta (number) -- angle in radiansThe dot product of two vectors of the same dimension. Also the dot product of two quaternions.
a (vector) -- b (vector) -- same dimension as aThe magnitude (length) of a vector.
v (vector) -- The cross product of two vectors of the same dimension -- a scalar (the z-component) for two 2D vectors, a vector for two 3D vectors.
a (vector) -- b (vector) -- same dimension as aThe angle, in radians, a 2D vector makes with the x-axis. 2D only -- there is no single reference axis in 3D.
v (vector2) -- The angle, in radians, between two vectors of the same dimension.
a (vector) -- b (vector) -- same dimension as aThe scalar projection of a onto b -- the length of a's component along b.
a (vector) -- b (vector) -- same dimension as aThe vector projection of a onto b -- a's component along b, as a vector.
a (vector) -- b (vector) -- same dimension as aThe vector rejection of a from b -- a's component perpendicular to b.
a (vector) -- b (vector) -- same dimension as aThe scalar triple product a . (b x c), for three 3D vectors -- the signed volume of the parallelepiped they span.
a (vector3) -- b (vector3) -- c (vector3) -- The vector triple product a x (b x c), for three 3D vectors.
a (vector3) -- b (vector3) -- c (vector3) --