Expand description
A 2D triangle defined by three points a
, b
and c
.
Fields
a: Point<S>
b: Point<S>
c: Point<S>
Implementations
sourceimpl<S: Scalar> Triangle<S>
impl<S: Scalar> Triangle<S>
pub fn contains_point(&self, point: Point<S>) -> bool
sourcepub fn bounding_range_x(&self) -> (S, S)
pub fn bounding_range_x(&self) -> (S, S)
Returns a conservative range of x that contains this triangle.
sourcepub fn bounding_range_y(&self) -> (S, S)
pub fn bounding_range_y(&self) -> (S, S)
Returns a conservative range of y that contains this triangle.
sourcepub fn bounding_box(&self) -> Box2D<S>
pub fn bounding_box(&self) -> Box2D<S>
Returns the smallest rectangle that contains this triangle.
sourcepub fn bounding_rect(&self) -> Rect<S>
pub fn bounding_rect(&self) -> Rect<S>
Returns the smallest rectangle that contains this triangle.
pub fn ab(&self) -> LineSegment<S>
pub fn ba(&self) -> LineSegment<S>
pub fn bc(&self) -> LineSegment<S>
pub fn cb(&self) -> LineSegment<S>
pub fn ca(&self) -> LineSegment<S>
pub fn ac(&self) -> LineSegment<S>
sourcepub fn transform<T: Transformation<S>>(&self, transform: &T) -> Self
pub fn transform<T: Transformation<S>>(&self, transform: &T) -> Self
[Not implemented] Applies the transform to this triangle and returns the results.
sourcepub fn intersects(&self, other: &Self) -> bool
pub fn intersects(&self, other: &Self) -> bool
Test for triangle-triangle intersection.
sourcepub fn intersects_line_segment(&self, segment: &LineSegment<S>) -> bool
pub fn intersects_line_segment(&self, segment: &LineSegment<S>) -> bool
Test for triangle-segment intersection.
Trait Implementations
impl<S: Copy> Copy for Triangle<S>
impl<S> StructuralPartialEq for Triangle<S>
Auto Trait Implementations
impl<S> RefUnwindSafe for Triangle<S> where
S: RefUnwindSafe,
impl<S> Send for Triangle<S> where
S: Send,
impl<S> Sync for Triangle<S> where
S: Sync,
impl<S> Unpin for Triangle<S> where
S: Unpin,
impl<S> UnwindSafe for Triangle<S> where
S: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more