pub trait CurveEvaluator<C>:
Debug
+ Send
+ Sync {
type Point;
type Derivative;
type Error: Error + Send + Sync + 'static;
// Required methods
fn domain(&self, curve: &C) -> Interval;
fn evaluate(
&self,
curve: &C,
t: Scalar,
tolerance: Tolerance,
) -> Result<Self::Point, Self::Error>;
fn derivative(
&self,
curve: &C,
t: Scalar,
tolerance: Tolerance,
) -> Result<Self::Derivative, Self::Error>;
}Expand description
Evaluate and differentiate one curve representation.
The trait is generic over the curve value so third-party backends can add implementations without a central enum or source-format dependency.
Required Associated Types§
Sourcetype Derivative
type Derivative
First derivative returned by evaluation.
Required Methods§
Sourcefn evaluate(
&self,
curve: &C,
t: Scalar,
tolerance: Tolerance,
) -> Result<Self::Point, Self::Error>
fn evaluate( &self, curve: &C, t: Scalar, tolerance: Tolerance, ) -> Result<Self::Point, Self::Error>
Position at parameter t.
Sourcefn derivative(
&self,
curve: &C,
t: Scalar,
tolerance: Tolerance,
) -> Result<Self::Derivative, Self::Error>
fn derivative( &self, curve: &C, t: Scalar, tolerance: Tolerance, ) -> Result<Self::Derivative, Self::Error>
First derivative at parameter t.