Skip to content

Api > Vector3 > Slerp()


Vector3.Slerp(Vector3 a, Vector3 b, number t)⚓︎

Spherically interpolates between two vectors.

Parameters:⚓︎

Name Type Description
a Vector3
b Vector3
t number is clamped to the range [0, 1].

Returns:⚓︎

type Description
Vector3 Spherically interpolated Vector3

Usage⚓︎

---@type Vector3
local a;

---@type Vector3
local b;

---@type number
local t;


local val0 = Vector3:Slerp(a, b, t)

Extra Detail⚓︎

Interpolates between a and b by amount t. The difference between this and linear interpolation (aka, "lerp") is that the vectors are treated as directions rather than points in space. The direction of the returned vector is interpolated by the angle and its magnitude is interpolated between the magnitudes of from and to.