pub trait ParamCurve: Sized {
// Required methods
fn eval(&self, t: f64) -> Point;
fn subsegment(&self, range: Range<f64>) -> Self;
// Provided methods
fn subdivide(&self) -> (Self, Self) { ... }
fn start(&self) -> Point { ... }
fn end(&self) -> Point { ... }
}
Expand description
A curve parameterized by a scalar.
If the result is interpreted as a point, this represents a curve. But the result can be interpreted as a vector as well.
Required Methods§
Sourcefn eval(&self, t: f64) -> Point
fn eval(&self, t: f64) -> Point
Evaluate the curve at parameter t
.
Generally t
is in the range [0..1].
Sourcefn subsegment(&self, range: Range<f64>) -> Self
fn subsegment(&self, range: Range<f64>) -> Self
Get a subsegment of the curve for the given parameter range.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.