Trait kurbo::ParamCurve

source ·
pub trait ParamCurve: Sized {
    fn eval(&self, t: f64) -> Vec2;
    fn subsegment(&self, range: Range<f64>) -> Self;

    fn subdivide(&self) -> (Self, Self) { ... }
    fn start(&self) -> Vec2 { ... }
    fn end(&self) -> Vec2 { ... }
}
Expand description

A curve parametrized 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§

Evaluate the curve at parameter t.

Generally t is in the range [0..1].

Get a subsegment of the curve for the given parameter range.

Provided Methods§

Subdivide into (roughly) halves.

The start point.

The end point.

Implementors§