Struct kurbo::Line [−][src]
A single line.
Fields
p0: Point
The line’s start point.
p1: Point
The line’s end point.
Implementations
impl Line
[src]
pub fn new(p0: impl Into<Point>, p1: impl Into<Point>) -> Line
[src]
Create a new line.
pub fn length(self) -> f64
[src]
The length of the line.
pub fn is_finite(self) -> bool
[src]
Is this line finite?
pub fn is_nan(self) -> bool
[src]
Is this line NaN?
Trait Implementations
impl Add<Vec2> for Line
[src]
type Output = Line
The resulting type after applying the +
operator.
fn add(self, v: Vec2) -> Line
[src]
impl Clone for Line
[src]
impl Copy for Line
[src]
impl Debug for Line
[src]
impl<'de> Deserialize<'de> for Line
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl From<Line> for PathSeg
[src]
impl Mul<Line> for Affine
[src]
type Output = Line
The resulting type after applying the *
operator.
fn mul(self, other: Line) -> Line
[src]
impl Mul<Line> for TranslateScale
[src]
type Output = Line
The resulting type after applying the *
operator.
fn mul(self, other: Line) -> Line
[src]
impl ParamCurve for Line
[src]
fn eval(&self, t: f64) -> Point
[src]
fn start(&self) -> Point
[src]
fn end(&self) -> Point
[src]
fn subsegment(&self, range: Range<f64>) -> Line
[src]
fn subdivide(&self) -> (Self, Self)
[src]
impl ParamCurveArclen for Line
[src]
fn arclen(&self, _accuracy: f64) -> f64
[src]
fn inv_arclen(&self, arclen: f64, _accuracy: f64) -> f64
[src]
impl ParamCurveArea for Line
[src]
fn signed_area(&self) -> f64
[src]
impl ParamCurveCurvature for Line
[src]
impl ParamCurveDeriv for Line
[src]
type DerivResult = ConstPoint
The parametric curve obtained by taking the derivative of this one.
fn deriv(&self) -> ConstPoint
[src]
fn gauss_arclen(&self, coeffs: &[(f64, f64)]) -> f64
[src]
impl ParamCurveExtrema for Line
[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 Line
[src]
impl PartialEq<Line> for Line
[src]
impl Serialize for Line
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl Shape for Line
[src]
type PathElementsIter = LinePathIter
The iterator returned by the path_elements
method. Read more
fn path_elements(&self, _tolerance: f64) -> LinePathIter
[src]
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 perimeter(&self, _accuracy: f64) -> f64
[src]
fn winding(&self, _pt: Point) -> i32
[src]
Same consideration as area
.
fn bounding_box(&self) -> Rect
[src]
fn as_line(&self) -> Option<Line>
[src]
fn to_path(&self, tolerance: f64) -> BezPath
[src]
fn into_path(self, tolerance: f64) -> BezPath
[src]
fn path_segments(&self, tolerance: f64) -> Segments<Self::PathElementsIter>ⓘ
[src]
fn contains(&self, pt: Point) -> bool
[src]
fn as_rect(&self) -> Option<Rect>
[src]
fn as_rounded_rect(&self) -> Option<RoundedRect>
[src]
fn as_circle(&self) -> Option<Circle>
[src]
fn as_path_slice(&self) -> Option<&[PathEl]>
[src]
impl StructuralPartialEq for Line
[src]
impl Sub<Vec2> for Line
[src]
Auto Trait Implementations
impl RefUnwindSafe for Line
impl Send for Line
impl Sync for Line
impl Unpin for Line
impl UnwindSafe for Line
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,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
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.
pub 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>,