Expand description
A single quadratic Bézier segment.
Fields§
§p0: Vec2
§p1: Vec2
§p2: Vec2
Implementations§
Trait Implementations§
source§impl ParamCurve for QuadBez
impl ParamCurve for QuadBez
source§impl ParamCurveArclen for QuadBez
impl ParamCurveArclen for QuadBez
source§fn arclen(&self, _accuracy: f64) -> f64
fn arclen(&self, _accuracy: f64) -> f64
Arclength of a quadratic Bézier segment.
This computation is based on an analytical formula. Since that formula suffers from numerical instability when the curve is very close to a straight line, we detect that case and fall back to Legendre-Gauss quadrature.
Accuracy should be better than 1e-13 over the entire range.
Adapted from http://www.malczak.linuxpl.com/blog/quadratic-bezier-curve-length/ with permission.
source§impl ParamCurveArea for QuadBez
impl ParamCurveArea for QuadBez
source§fn signed_area(&self) -> f64
fn signed_area(&self) -> f64
Compute the signed area under the curve. Read more