Trait piet_common::kurbo::ParamCurveDeriv[]

pub trait ParamCurveDeriv {
    type DerivResult: ParamCurve;
    pub fn deriv(&self) -> Self::DerivResult;

    pub fn gauss_arclen(&self, coeffs: &[(f64, f64)]) -> f64 { ... }
}

A differentiable parametrized curve.

Associated Types

type DerivResult: ParamCurve

The parametric curve obtained by taking the derivative of this one.

Loading content...

Required methods

pub fn deriv(&self) -> Self::DerivResult

The derivative of the curve.

Note that the type of the return value is somewhat inaccurate, as the derivative of a curve (mapping of param to point) is a mapping of param to vector. We choose to accept this rather than have a more complex type scheme.

Loading content...

Provided methods

pub fn gauss_arclen(&self, coeffs: &[(f64, f64)]) -> f64

Estimate arclength using Gaussian quadrature.

The coefficients are assumed to cover the range (-1..1), which is traditional.

Loading content...

Implementors

impl ParamCurveDeriv for ConstPoint

type DerivResult = ConstPoint

impl ParamCurveDeriv for CubicBez

type DerivResult = QuadBez

impl ParamCurveDeriv for Line

type DerivResult = ConstPoint

impl ParamCurveDeriv for QuadBez

type DerivResult = Line

Loading content...