Skip to contents

Returns the spherical linear interpolation of points between two vectors

Usage

slerp(x0, x1, t)

Arguments

x0, x1

objects of class "Vec3", "Line", or "Plane" of the first and the last points of the to be interpolated arc.

t

numeric. Interpolation factor(s) (t = [0, 1]).

Details

A Slerp path is the spherical geometry equivalent of a path along a line segment in the plane; a great circle is a spherical geodesic.

Note

For non-unit vectors the interpolation is not uniform.

Examples

x0 <- Line(120, 7)
x1 <- Line(10, 13)
t <- seq(0, 1, .05)
xslerp <- slerp(x0, x1, t)

plot(xslerp, col = assign_col(t))
points(rbind(x0, x1))