[][src]Struct kurbo::Line

pub struct Line {
    pub p0: Vec2,
    pub p1: Vec2,
}

A single line.

Fields

p0: Vec2p1: Vec2

Methods

impl Line[src]

pub fn new<V: Into<Vec2>>(p0: V, p1: V) -> Line[src]

Trait Implementations

impl ParamCurve for Line[src]

fn subdivide(&self) -> (Self, Self)[src]

Subdivide into (roughly) halves.

impl ParamCurveDeriv for Line[src]

type DerivResult = ConstVec2

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

Estimate arclength using Gaussian quadrature. Read more

impl ParamCurveArclen for Line[src]

fn inv_arclen(&self, arclen: f64, accuracy: f64) -> f64[src]

Solve for the parameter that has the given arclength from the start. Read more

impl ParamCurveArea for Line[src]

impl ParamCurveNearest for Line[src]

impl ParamCurveCurvature for Line[src]

impl ParamCurveExtrema for Line[src]

fn extrema_ranges(&self) -> ArrayVec<[Range<f64>; 5]>[src]

Return parameter ranges, each of which is monotonic within the range.

fn bounding_box(&self) -> Rect[src]

The smallest rectangle that encloses the curve in the range (0..1).

impl Shape for Line[src]

type BezPathIter = LinePathIter

The iterator resulting from to_bez_path.

fn area(&self) -> f64[src]

Returning zero here is consistent with the contract (area is only meaningful for closed shapes), but an argument can be made that the contract should be tightened to include the Green's theorem contribution.

fn winding(&self, _pt: Vec2) -> i32[src]

Same consideration as area.

fn into_bez_path(self, tolerance: f64) -> BezPath[src]

fn as_rect(&self) -> Option<Rect>[src]

If the shape is a rectangle, make it available.

fn as_circle(&self) -> Option<Circle>[src]

If the shape is a circle, make it available.

fn as_path_slice(&self) -> Option<&[PathEl]>[src]

If the shape is stored as a slice of path elements, make that available. Read more

impl Clone for Line[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Copy for Line[src]

impl Debug for Line[src]

impl Mul<Line> for Affine[src]

type Output = Line

The resulting type after applying the * operator.

Auto Trait Implementations

impl Send for Line

impl Sync for Line

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.