Cubic Hermitian spline
In the mathematical sub-field of numerics , a cubic Hermitian spline (also called cSpline ) is understood to be a spline that interpolates between control points. The control points are connected by segments, which consist of cubic polynomials, which are continuously differentiable . This means that one part of the curve ends exactly where the next one begins, and, moreover, that the two tangents coincide in their direction at the segment boundary, which results in a smooth transition (without kink) from segment to segment. The individual sub-curves are clearly defined by the start and end point as well as the incoming and outgoing tangent vector.
This spline definition is particularly widespread in computer animation programs in order to interpolate between individual keyframes , which can also have different time intervals from one another. In addition to the cubic splines, there are also splines with a higher or lower order. However, lower orders are classified as too inflexible and higher orders as too costly to implement. In particular, higher-order splines tend to "overshoot", which could disturb the animator in his work through undesired processes. In addition, there is the effective possibility of being able to calculate and influence the tangents, as is the case, for example, with the Kochanek-Bartels spline discussed later. The definition of a segment of this spline is also closely related to the cubic Bézier curve , so that both can be converted into one another. This makes it possible to use the algorithms for Bézier curves (e.g. the De Casteljau algorithm ) also to calculate and display cubic Hermitian splines.
Definition of a segment
In the unit interval
In the unit interval , a segment of the cubic Hermitian spline is defined by the following cubic Hermitian curve :
It is the starting point at and the endpoint . The points can be multi-dimensional and are linearly independent of one another. and are the associated tangents at the start and end point. It should be noted that the tangent of the end point points in the direction of escape. It is not to be equated with the second middle control point of the Bézier curve , since the definition is fundamentally different.
The function can be represented more clearly in matrix notation :
is referred to as the Hermitian matrix .
In the value interval
In the general interval , the function is stretched accordingly, which results from the equation and the tangents must be scaled in the same ratio. As a result, the distance of the interval is added as an additional parameter that results from if the tangents are not already normalized for the value interval. In the case of a normalization .
Derivation
Let the points and and their associated tangents and be given. Likewise, the function sought should be a third degree polynomial, which can generally be represented as .
At the same time, it is assumed that two adjacent segments share the start and end point and that there is a smooth transition, i.e. they have the same start and end point and have the same derivative at these points. This creates four conditions that can be described as follows:
The polynomial mentioned at the beginning can be clearly described in matrix form:
It follows for and :
For the tangents, the function must be derived once , so that the following equations result:
The four relationships gained can be summarized as follows:
The equation can now by multiplication with the inverse to be resolved.
Inserted into the general cubic equation results in the definition of the segment of the cubic Hermitian spline mentioned at the beginning.
Representations and Relationships
The Hermitian basic functions can be represented in different ways, whereby different properties of the curve segments can be read off directly.
presentation | ||||
---|---|---|---|---|
expands | ||||
factored | ||||
Amber |
The expanded form can be obtained directly from the derivation and is usually used for definition, as is the case here.
It can be seen directly from the factorization that at has a zero and the increase is the same . The same applies to for . and , on the other hand, have a multiplicity of 2 and each have a zero at the end and the beginning of the definition range .
When considering the Bernstein polynomial of 3rd order which is analogous to the cubic Bezier curve can be seen, the Bernstein polynomial , , and are. Accordingly, there is a direct connection between the two equations, from which the following relationships result,
if the Bézier curve is defined as follows:
- .
Because of this connection, the De Casteljau algorithm can be used to calculate interpolations using cubic Hermitian splines. It can also be seen that in a cubic Bézier curve, the central control points define the direction of the tangent at the end points.
Uniqueness
The definition of the segment guarantees that the path between two points is unique. This means that no second polynomial different from that can be found that has the same course.
Illustrative behavior
While the direction of each tangent vector indicates in which direction the curve leaves or reaches the associated point , the amount (the "length") of each tangent vector describes how strong its influence on the curve is: From the direction of a short vector, the curve can move quickly it can only slowly detach from the direction of a long vector.
If it is irrelevant in which direction the spline leaves a point, the associated tangent vector can be set to.
interpolation
The scheme of the segment-wise cubic Hermitian spline can be used to define for a data set with the control points for a curve which runs through the control point and whose tangents are selected in such a way that a smooth transition between the segments results. This means that the tangents of adjacent segments are the same in their common point. The curve interpolated in this way then consists of piece-wise differentiable segments and is even continuously differentiable in the area .
The choice of tangents, on the other hand, is not clear, so that different determination methods with different results have become established.
Finite difference
The simplest method for choosing the tangents ( increase in the one-dimensional case) is to use the finite difference . It can be used to calculate the tangents for a segment in the unit interval and as follows:
For end points ( and ) either the one-sided difference is used, which effectively corresponds to a doubling of the start and end points. Alternatively, a predecessor and successor are estimated, for which there are different approaches.
Catmull Rom Spline
If you summarize the above equation, multiply it by and define a factor , you get the Catmull-Rom spline.
From the part of the equation it can be seen that the tangent is based on the direction of the vector from to . In the meantime, the parameter scales this vector so that the curve segment becomes wider or sharper. This parameter is often set to a fixed value , which again results in the initial equation.
This curve is named after Edwin Catmull and Raphael Rom . In computer graphics , this form is often used to distinguish between keyframes display (keyframes) to interpolate or graphic objects. They are widely used mainly because of their simple calculation and meet the condition that each key frame is reached exactly while the movement continues smoothly and without jumps from segment to segment. It should be noted that changing a control point changes a total of four curve segments by determining the neighboring tangents.
Cardinal spline
A cardinal spline is obtained when the tangents are determined as follows:
The parameter is understood as the voltage of the curve and must be in the interval of . Considered clearly, the parameter determines the "length of the tangents", which means that they have no length, leads to tangents that are twice as long, which results in a very smooth passage through the control point.
Kochanek-Bartels spline
The Kochanek-Bartels spline (also called TCB spline) is a further generalization for the choice of tangents, which can be influenced by the parameters tension , continuity and bias . They were introduced in 1984 by Doris HU Kochanek and Richard H. Bartels to give users greater control over the course of the interpolation in keyframe animation. They became known through applications such as 3ds Max from Discreet or LightWave 3D from NewTek.
The basis for the Kochanek-Bartels splines is the -continuous Hermitian spline, which allows left and right-hand tangents ( and ) at a control point .
Tension
The tension parameter is comparable to the parameter of the cardinal spline and also influences the length of the tangents at the control point. In analogy to the tangent direction of the Catmull-Rom spline:
For negative values, the curve goes through the control point in a wide arc, while for positive values it contracts strongly. In the case of , the tangents have a length of , which creates a sharp but still continuous kink. At the tangent is twice as long as at which results in a wide arc through the control point.
Continuity
The continuity parameter lets the tangents diverge in their direction. Accordingly, the parameter acts differently on the left and right-hand tangent:
The spline is no longer -continuous for values of . The curve shows corners that become sharper with increasing . The sign defines meanwhile whether the corner to the "outside" or "inside" shows.
Bias
The bias parameter determines which segment has a stronger influence on the tangent. The common tangent rotates accordingly in the direction of the weight.
Summary of TCB
If one summarizes the obtained properties for the tangents, one obtains the following equations for the incoming and outgoing tangent of :
- Unit interval
- Value interval
literature
- IJ Schoenberg: Cardinal Spline Interpolation . No. 12 . SIAM (Society for Industrial and Applied Mathematics), 1987, ISBN 0-89871-009-X .
- Michael Bender, Manfred Brill: Computer graphics: An application-oriented textbook . No. 2 . Hanser Verlag, 2005, ISBN 3-446-40434-1 .
- David Salomon: Curves and surfaces for computer graphics . Springer, 2006, ISBN 0-387-24196-5 .
Web links
- Donald H. House: Spline Curves (PDF; 5.4 MB). Clemson University (English).
- Chandrajit Bajaj: Multi-dimensional Hermite Interpolation and Approximation (PDF; 207 kB). Purdue University (English).
Individual evidence
- ^ G. Scott Owen: Hermite Splines. Sisgraph, September 2, 1999, accessed November 1, 2010 .
- ↑ ^{a } ^{b } ^{c} Michael Bender, Manfred Brill: Computer graphics: An application-oriented textbook . No. 2 . Hanser Verlag, 2005, ISBN 3-446-40434-1 , p. 139 ff .
- ^ IJ Schoenberg: Cardinal Spline Interpolation . No. 12 . SIAM (Society for Industrial and Applied Mathematics), 1987, ISBN 0-89871-009-X , p. 33 ff .
- ↑ David Salomon: Curves and surfaces for computer graphics . Springer, 2006, ISBN 0-387-24196-5 , pp. 161 ff .
- ↑ David Salomon: Curves and surfaces for computer graphics . Springer, 2006, ISBN 0-387-24196-5 , pp. 167 ff .
- ^ David Eberly: Kochanek-Bartels Cubic Splines (TCB Splines). (No longer available online.) Geometric Tools, LLC, February 14, 2008, archived from the original on April 13, 2014 ; accessed on November 1, 2010 (English). Info: The archive link was inserted automatically and has not yet been checked. Please check the original and archive link according to the instructions and then remove this notice.