Curve<T> Class
Definition
Assembly: Numerics.NET.Generic (in Numerics.NET.Generic.dll) Version: 9.0.1
[SerializableAttribute]
public abstract class Curve<T> : ICloneable
where T : Object, INumberBase<T>
- Inheritance
- Object → Curve<T>
- Derived
- Implements
- ICloneable
Type Parameters
- T
Remarks
The Curve class is the abstract base class for classes that represent curves in two-dimensional space. It defines common properties and methods for all such classes. Derived classes provide implementations for specific types of curves.
The name 'Curve' was chosen as an alternative to 'Function', which is a reserved word in many languages.
The ValueAt(T) method evaluates the curve at a specific point. SlopeAt(T) evaluates the derivative, and Integral(T, T) evaluates the definite integral over a specified interval. If overridden by a descendant class, the GetDerivative() method returns the Curve that is the derivative of the instance. The FindRoots() method attempts to find all the roots or zeros of the curve.
A particular type of curve is defined by a set of parameters. These parameters can be set and retrieved through the Parameters property which is a vector. The number of such parameters is given by the Length property of the Parameters property.
Curve is an abstract base class and cannot be instantiated directly. The following derived classes have been defined:
Class | Description |
---|---|
General | A curve whose value and optionally its derivative is calculated using a function of one variable delegate. |
Linear | A linear combination of an arbitrary set of curves. |
Polynomial | Abstract base class for classes that implement different types of polynomials. Derives from LinearCombination. |
Polynomial | A polynomial. Derives from PolynomialBase. |
Chebyshev | A linear combination of Chebyshev polynomials. Derives from PolynomialBase. |
Cubic | A natural or clamped cubic spline. Derives from PiecewiseCurve. |
Nonlinear | A curve that is non-linear in its parameters and is suitable for non-linear curve fitting. |
Notes to inheritors: When you derive from Curve, you must override the following member: ValueAt(T). You should also override the following members: SlopeAt(T), Integral(T, T), FindRoots(), and GetDerivative().
Constructors
Curve<T> | Constructs a new curve with the specified number of parameters. |
Properties
Parameters | Gets the collection of parameters that determine the shape of this Curve. |
Methods
Clone | Constructs an exact copy of this instance. |
Equals | Determines whether the specified object is equal to the current object. (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) |
Find | Gets the set of X-coordinates where the curve crosses the X-axis. |
Get | Returns a CurveFitter object that can be used to fit the curve to data. |
Get | Returns a Curve that represents the derivative of this Curve. |
Get | Serves as the default hash function. (Inherited from Object) |
Get | Gets the Type of the current instance. (Inherited from Object) |
Integral | Gets the definite integral of the curve between the specified X-coordinates. |
Memberwise | Creates a shallow copy of the current Object. (Inherited from Object) |
OnParameter | Called after a Curve parameter has been changed. |
OnParameter | Called before the value of a curve parameter is changed. |
Set | Sets a curve parameter to the specified value. |
Slope | Gets the slope of the curve at the specified X-coordinate. |
Solve | Finds the x value where the curve reaches the specified y value. |
Tangent | Gets the tangent line to the curve at the specified X-coordinate. |
ToString | Returns a string that represents the current object. (Inherited from Object) |
Value | Gets the Y-value of the curve at the specified X-coordinate. |