pub struct Triangle<S> {
pub a: Point<S>,
pub b: Point<S>,
pub c: Point<S>,
}
Expand description
A 2D triangle defined by three points a
, b
and c
.
Fields§
§a: Point<S>
§b: Point<S>
§c: Point<S>
Implementations§
source§impl<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.
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> Freeze for Triangle<S>where
S: Freeze,
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§
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)