HOME

TheInfoList



OR:

In
computer graphics Computer graphics deals with generating images and art with the aid of computers. Computer graphics is a core technology in digital photography, film, video games, digital art, cell phone and computer displays, and many specialized applications. ...
, slerp is shorthand for spherical linear interpolation, introduced by Ken Shoemake in the context of
quaternion In mathematics, the quaternion number system extends the complex numbers. Quaternions were first described by the Irish mathematician William Rowan Hamilton in 1843 and applied to mechanics in three-dimensional space. The algebra of quater ...
interpolation In the mathematics, mathematical field of numerical analysis, interpolation is a type of estimation, a method of constructing (finding) new data points based on the range of a discrete set of known data points. In engineering and science, one ...
for the purpose of animating 3D
rotation Rotation or rotational/rotary motion is the circular movement of an object around a central line, known as an ''axis of rotation''. A plane figure can rotate in either a clockwise or counterclockwise sense around a perpendicular axis intersect ...
. It refers to constant-speed motion along a unit-radius
great circle In mathematics, a great circle or orthodrome is the circular intersection of a sphere and a plane passing through the sphere's center point. Discussion Any arc of a great circle is a geodesic of the sphere, so that great circles in spher ...
arc, given the ends and an interpolation parameter between 0 and 1.


Geometric slerp

Slerp has a geometric formula independent of quaternions, and independent of the dimension of the space in which the arc is embedded. This formula, a symmetric weighted sum credited to Glenn Davis, is based on the fact that any point on the curve must be a
linear combination In mathematics, a linear combination or superposition is an Expression (mathematics), expression constructed from a Set (mathematics), set of terms by multiplying each term by a constant and adding the results (e.g. a linear combination of ''x'' a ...
of the ends. Let ''p''0 and ''p''1 be the first and last points of the arc, and let ''t'' be the parameter, . Compute Ω as the angle subtended by the arc, so that , the ''n''-dimensional
dot product In mathematics, the dot product or scalar productThe term ''scalar product'' means literally "product with a Scalar (mathematics), scalar as a result". It is also used for other symmetric bilinear forms, for example in a pseudo-Euclidean space. N ...
of the unit vectors from the origin to the ends. The geometric formula is then : \operatorname(p_0,p_1; t) = \frac p_0 + \frac p_1. The symmetry lies in the fact that . In the limit as , this formula reduces to the corresponding symmetric formula for
linear interpolation In mathematics, linear interpolation is a method of curve fitting using linear polynomials to construct new data points within the range of a discrete set of known data points. Linear interpolation between two known points If the two known po ...
, : \operatorname(p_0,p_1; t) = (1-t) p_0 + t p_1. A slerp path is, in fact, the spherical geometry equivalent of a path along a line segment in the plane; a great circle is a spherical
geodesic In geometry, a geodesic () is a curve representing in some sense the locally shortest path ( arc) between two points in a surface, or more generally in a Riemannian manifold. The term also has meaning in any differentiable manifold with a conn ...
. More familiar than the general slerp formula is the case when the end vectors are perpendicular, in which case the formula is . Letting , and applying the trigonometric identity , this becomes the slerp formula. The factor of in the general formula is a normalization, since a vector ''p''1 at an angle of Ω to ''p''0 projects onto the perpendicular ⊥''p''0 with a length of only . Some special cases of slerp admit more efficient calculation. When a circular arc is to be drawn into a raster image, the preferred method is some variation of Bresenham's circle algorithm. Evaluation at the special parameter values 0 and 1 trivially yields ''p''0 and ''p''1, respectively; and bisection, evaluation at , simplifies to , normalized. Another special case, common in animation, is evaluation with fixed ends and equal parametric steps. If ''p''''k''−1 and ''p''''k'' are two consecutive values, and if ''c'' is twice their dot product (constant for all steps), then the next value, ''p''''k''+1, is the reflection .


Quaternion slerp

When slerp is applied to unit
quaternion In mathematics, the quaternion number system extends the complex numbers. Quaternions were first described by the Irish mathematician William Rowan Hamilton in 1843 and applied to mechanics in three-dimensional space. The algebra of quater ...
s, the quaternion path maps to a path through 3D rotations in a standard way. The effect is a rotation with uniform
angular velocity In physics, angular velocity (symbol or \vec, the lowercase Greek letter omega), also known as the angular frequency vector,(UP1) is a pseudovector representation of how the angular position or orientation of an object changes with time, i ...
around a fixed rotation axis. When the initial end point is the identity quaternion, slerp gives a segment of a one-parameter subgroup of both the
Lie group In mathematics, a Lie group (pronounced ) is a group (mathematics), group that is also a differentiable manifold, such that group multiplication and taking inverses are both differentiable. A manifold is a space that locally resembles Eucli ...
of 3D rotations,
SO(3) In mechanics and geometry, the 3D rotation group, often denoted SO(3), is the group of all rotations about the origin of three-dimensional Euclidean space \R^3 under the operation of composition. By definition, a rotation about the origin is a ...
, and its universal covering group of unit quaternions, ''S''3. Slerp gives a straightest and shortest path between its quaternion end points, and maps to a rotation through an angle of 2Ω. However, because the covering is double (''q'' and −''q'' map to the same rotation), the rotation path may turn either the "short way" (less than 180°) or the "long way" (more than 180°). Long paths can be prevented by negating one end if the dot product, , is negative, thus ensuring that . Slerp also has expressions in terms of quaternion algebra, all using
exponentiation In mathematics, exponentiation, denoted , is an operation (mathematics), operation involving two numbers: the ''base'', , and the ''exponent'' or ''power'', . When is a positive integer, exponentiation corresponds to repeated multiplication ...
. Real powers of a quaternion are defined in terms of the quaternion exponential function, written as ''e''''q'' and given by the
power series In mathematics, a power series (in one variable) is an infinite series of the form \sum_^\infty a_n \left(x - c\right)^n = a_0 + a_1 (x - c) + a_2 (x - c)^2 + \dots where ''a_n'' represents the coefficient of the ''n''th term and ''c'' is a co ...
equally familiar from calculus, complex analysis and matrix algebra: : e^q = 1 + q + \frac + \frac + \cdots + \frac + \cdots . Writing a unit quaternion ''q'' in
versor In mathematics, a versor is a quaternion of Quaternion#Norm, norm one, also known as a unit quaternion. Each versor has the form :u = \exp(a\mathbf) = \cos a + \mathbf \sin a, \quad \mathbf^2 = -1, \quad a \in ,\pi where the r2 = −1 conditi ...
form, , with v a unit 3-vector, and noting that the quaternion square v2 equals −1 (implying a quaternion version of
Euler's formula Euler's formula, named after Leonhard Euler, is a mathematical formula in complex analysis that establishes the fundamental relationship between the trigonometric functions and the complex exponential function. Euler's formula states that, for ...
), we have , and . The identification of interest is , so that the real part of ''q'' is , the same as the geometric dot product used above. Here are four equivalent quaternion expressions for slerp. : \begin \operatorname(q_0, q_1, t) & = q_0 (q_0^ q_1)^t \\ pt& = q_1 (q_1^ q_0)^ \\ pt& = (q_0 q_1^)^ q_1 \\ pt& = (q_1 q_0^)^t q_0 \end The
derivative In mathematics, the derivative is a fundamental tool that quantifies the sensitivity to change of a function's output with respect to its input. The derivative of a function of a single variable at a chosen input value, when it exists, is t ...
of with respect to ''t'', assuming the ends are fixed, is log(''q''1''q''0−1) times the function value, where the quaternion
natural logarithm The natural logarithm of a number is its logarithm to the base of a logarithm, base of the e (mathematical constant), mathematical constant , which is an Irrational number, irrational and Transcendental number, transcendental number approxima ...
in this case yields half the 3D
angular velocity In physics, angular velocity (symbol or \vec, the lowercase Greek letter omega), also known as the angular frequency vector,(UP1) is a pseudovector representation of how the angular position or orientation of an object changes with time, i ...
vector. The initial tangent vector is
parallel transport In differential geometry, parallel transport (or parallel translation) is a way of transporting geometrical data along smooth curves in a manifold. If the manifold is equipped with an affine connection (a covariant derivative or connection on ...
ed to each tangent along the curve; thus the curve is, indeed, a geodesic. In the
tangent space In mathematics, the tangent space of a manifold is a generalization of to curves in two-dimensional space and to surfaces in three-dimensional space in higher dimensions. In the context of physics the tangent space to a manifold at a point can be ...
at any point on a quaternion slerp curve, the inverse of the exponential map transforms the curve into a line segment. Slerp curves not extending through a point fail to transform into lines in that point's tangent space. Quaternion slerps are commonly used to construct smooth animation curves by mimicking affine constructions like the de Casteljau algorithm for
Bézier curve A Bézier curve ( , ) is a parametric equation, parametric curve used in computer graphics and related fields. A set of discrete "control points" defines a smooth, continuous curve by means of a formula. Usually the curve is intended to approxima ...
s. Since the sphere is not an
affine space In mathematics, an affine space is a geometric structure that generalizes some of the properties of Euclidean spaces in such a way that these are independent of the concepts of distance and measure of angles, keeping only the properties relat ...
, familiar properties of affine constructions may fail, though the constructed curves may otherwise be entirely satisfactory. For example, the de Casteljau algorithm may be used to split a curve in affine space; this does not work on a sphere. The two-valued slerp can be extended to interpolate among many unit quaternions, but the extension loses the fixed execution-time of the slerp algorithm.


See also

*
Circular interpolation Circular may refer to: * The shape of a circle * ''Circular'' (album), a 2006 album by Spanish singer Vega * Circular letter (disambiguation), a document addressed to many destinations ** Government circular, a written statement of government pol ...
*
Quaternions and spatial rotation unit vector, Unit quaternions, known as versor, ''versors'', provide a convenient mathematics, mathematical notation for representing spatial Orientation (geometry), orientations and rotations of elements in three dimensional space. Specifically, th ...
* Spherical mean (statistics)


References


External links

* * * * {{refend Computer graphics algorithms Quaternions Interpolation Rotation in three dimensions Spherical curves