#[repr(C)]pub struct LineSegment {
pub p0: Point,
pub p1: Point,
}
Expand description
A quadratic bezier curve segment in 2-dimensional Euclidian space.
Fields§
§p0: Point
§p1: Point
Implementations§
Source§impl LineSegment
impl LineSegment
Sourcepub fn new(p0: Point, p1: Point) -> LineSegment
pub fn new(p0: Point, p1: Point) -> LineSegment
Creates a new line segment with the given endpoints.
Sourcepub fn compare_to_point(self, p: Point) -> Option<Ordering>
pub fn compare_to_point(self, p: Point) -> Option<Ordering>
Compares self
to the point p
.
Returns Ordering::Less
if self
lies below p
, Ordering::Greater
if self
lies
above p
, and Ordering::Equal
if self
is incident to p
.
Sourcepub fn intersect_with_vertical_line(self, x: f64) -> Option<Point>
pub fn intersect_with_vertical_line(self, x: f64) -> Option<Point>
Returns the intersection point of the supporting line of self
with the vertical line
through x
, or None if these lines are coincident.
Trait Implementations§
Source§impl Clone for LineSegment
impl Clone for LineSegment
Source§fn clone(&self) -> LineSegment
fn clone(&self) -> LineSegment
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for LineSegment
impl Debug for LineSegment
Source§impl PartialEq for LineSegment
impl PartialEq for LineSegment
Source§impl Transform for LineSegment
impl Transform for LineSegment
fn transform<T>(self, t: &T) -> LineSegmentwhere
T: Transformation,
fn transform_mut<T>(&mut self, t: &T)where
T: Transformation,
impl Copy for LineSegment
impl StructuralPartialEq for LineSegment
Auto Trait Implementations§
impl Freeze for LineSegment
impl RefUnwindSafe for LineSegment
impl Send for LineSegment
impl Sync for LineSegment
impl Unpin for LineSegment
impl UnwindSafe for LineSegment
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more