Trait CurveEvaluator

Source
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: f64,
        tolerance: Tolerance,
    ) -> Result<Self::Point, Self::Error>;
    fn derivative(
        &self,
        curve: &C,
        t: f64,
        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§

Source

type Point

Point returned by evaluation.

Source

type Derivative

First derivative returned by evaluation.

Source

type Error: Error + Send + Sync + 'static

Evaluator-specific structured error.

Required Methods§

Source

fn domain(&self, curve: &C) -> Interval

Supported parameter interval.

Source

fn evaluate( &self, curve: &C, t: f64, tolerance: Tolerance, ) -> Result<Self::Point, Self::Error>

Position at parameter t.

Source

fn derivative( &self, curve: &C, t: f64, tolerance: Tolerance, ) -> Result<Self::Derivative, Self::Error>

First derivative at parameter t.

Implementors§