Click or drag to resize
DigitalRuneCatmullRomSegment2F Class
Defines a single segment of a 2-dimensional cubic Catmull-Rom spline (single-precision).
Inheritance Hierarchy
SystemObject
  DigitalRune.Mathematics.InterpolationCatmullRomSegment2F

Namespace: DigitalRune.Mathematics.Interpolation
Assembly: DigitalRune.Mathematics (in DigitalRune.Mathematics.dll) Version: 1.14.0.0 (1.14.0.14427)
Syntax
public class CatmullRomSegment2F : ICurve<float, Vector2F>, 
	IRecyclable

The CatmullRomSegment2F type exposes the following members.

Constructors
  NameDescription
Public methodCatmullRomSegment2F
Initializes a new instance of the CatmullRomSegment2F class
Top
Methods
  NameDescription
Public methodStatic memberCreate
Creates an instance of the CatmullRomSegment2F class. (This method reuses a previously recycled instance or allocates a new instance if necessary.)
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodFlatten
Computes the points of a sequence of line segments which approximate the curve.
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetLength
Computes the approximated length of the curve for the parameter interval [start, end].
Public methodGetPoint
Computes a point on the curve.
Public methodGetTangent
Computes the tangent for a point on the curve.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodRecycle
Recycles this instance.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Properties
  NameDescription
Public propertyPoint1
Gets or sets the previous point.
Public propertyPoint2
Gets or sets the start point.
Public propertyPoint3
Gets or sets the end point.
Public propertyPoint4
Gets or sets the subsequent point.
Top
Remarks

A CatmullRomSegment2F 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 Catmull-Rom 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 the average of the slope from the previous point and the slope to the next point.

The Catmull-Rom spline is defined as:

C(u) = ((-u3 + 2 u2 - u) p1 + (3 u3 - 5 u2 + 2) p2 + (-3 u3 + 4 u2 + u) p3 + (u3 - u2) p4 )/ 2

where u is the interpolation parameter.

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.

See Also