[−][src]Struct piet_common::kurbo::QuadBez
A single quadratic Bézier segment.
Fields
p0: Pointp1: Pointp2: PointMethods
impl QuadBez[src]
pub fn new<V>(p0: V, p1: V, p2: V) -> QuadBez where
V: Into<Point>, [src]
V: Into<Point>,
Create a new quadratic Bézier segment.
pub fn raise(&self) -> CubicBez[src]
Raise the order by 1.
Returns a cubic Bézier segment that exactly represents this quadratic.
Trait Implementations
impl Clone for QuadBez[src]
fn clone(&self) -> QuadBez[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]
impl Copy for QuadBez[src]
impl Debug for QuadBez[src]
impl From<QuadBez> for PathSeg[src]
impl Mul<QuadBez> for TranslateScale[src]
type Output = QuadBez
The resulting type after applying the * operator.
fn mul(self, other: QuadBez) -> QuadBez[src]
impl Mul<QuadBez> for Affine[src]
type Output = QuadBez
The resulting type after applying the * operator.
fn mul(self, other: QuadBez) -> QuadBez[src]
impl ParamCurve for QuadBez[src]
fn eval(&self, t: f64) -> Point[src]
fn start(&self) -> Point[src]
fn end(&self) -> Point[src]
fn subdivide(&self) -> (QuadBez, QuadBez)[src]
Subdivide into halves, using de Casteljau.
fn subsegment(&self, range: Range<f64>) -> QuadBez[src]
impl ParamCurveArclen for QuadBez[src]
fn arclen(&self, _accuracy: f64) -> f64[src]
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.
fn inv_arclen(&self, arclen: f64, accuracy: f64) -> f64[src]
impl ParamCurveArea for QuadBez[src]
fn signed_area(&self) -> f64[src]
impl ParamCurveCurvature for QuadBez[src]
impl ParamCurveDeriv for QuadBez[src]
type DerivResult = Line
fn deriv(&self) -> Line[src]
fn gauss_arclen(&self, coeffs: &[(f64, f64)]) -> f64[src]
impl ParamCurveExtrema for QuadBez[src]
fn extrema(&self) -> ArrayVec<[f64; 4]>[src]
fn extrema_ranges(&self) -> ArrayVec<[Range<f64>; 5]>[src]
fn bounding_box(&self) -> Rect[src]
impl ParamCurveNearest for QuadBez[src]
fn nearest(&self, p: Point, _accuracy: f64) -> (f64, f64)[src]
Find nearest point, using analytical algorithm based on cubic root finding.
impl PartialEq<QuadBez> for QuadBez[src]
impl StructuralPartialEq for QuadBez[src]
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> RoundFrom<T> for T[src]
fn round_from(x: T) -> T[src]
impl<T, U> RoundInto<U> for T where
U: RoundFrom<T>, [src]
U: RoundFrom<T>,
fn round_into(self) -> U[src]
impl<T> Same<T> for T[src]
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,