CardinalSegment3F Class |
Namespace: DigitalRune.Mathematics.Interpolation
The CardinalSegment3F type exposes the following members.
Name | Description | |
---|---|---|
CardinalSegment3F | Initializes a new instance of the CardinalSegment3F class |
Name | Description | |
---|---|---|
Create |
Creates an instance of the CardinalSegment3F class. (This method reuses a
previously recycled instance or allocates a new instance if necessary.)
| |
Equals | (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
Flatten |
Computes the points of a sequence of line segments which approximate the curve.
| |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetLength |
Computes the approximated length of the curve for the parameter interval
[start, end].
| |
GetPoint |
Computes a point on the curve.
| |
GetTangent |
Computes the tangent for a point on the curve.
| |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
Recycle |
Recycles this instance.
| |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Name | Description | |
---|---|---|
Point1 |
Gets or sets the previous point.
| |
Point2 |
Gets or sets the start point.
| |
Point3 |
Gets or sets the end point.
| |
Point4 |
Gets or sets the subsequent point.
| |
Tension |
Gets or sets the tension constant.
|
A CardinalSegment3F can be used to smoothly interpolate between two points.
Given a series of points (Point1, Point2, Point3, Point4) this method performs a smooth interpolation between the points Point2 and Point3. The interpolation curve is known as as Cardinal spline. The curve (spline) is a specialization of the cubic Hermit spline. The curve runs through the control points Point2 and Point3. The tangent at each point is computed from the previous point and the following point. The tangent ti for point pi is computed as:
ti = 1/2 (1 - tension) (pi+1 - pi-1),
where tension is a parameter, which is a constant that modifies the length of the tangent. tension = 1 will yield zero tangents and tension = 0 yields a Catmull-Rom spline.
The curve function point = C(parameter) takes a scalar parameter and returns a point on the curve (see GetPoint(Single)). The curve parameter lies in the interval [0,1]; it is also known as interpolation parameter, interpolation factor or weight of the target point. C(0) returns the start point Point2; C(1) returns the end point Point3.