pub struct Triangle2 {
pub a: Point2,
pub b: Point2,
pub c: Point2,
}Expand description
A two-dimensional triangle.
Corner order sets the winding, which signed_area reports: positive is
counter-clockwise. Degenerate triangles are representable.
Fields§
§a: Point2First corner.
b: Point2Second corner.
c: Point2Third corner.
Implementations§
Source§impl Triangle2
impl Triangle2
Sourcepub const fn new(a: Point2, b: Point2, c: Point2) -> Self
pub const fn new(a: Point2, b: Point2, c: Point2) -> Self
Construct a triangle without validating it.
Sourcepub fn signed_area2(&self) -> Scalar
pub fn signed_area2(&self) -> Scalar
Twice the signed area: positive counter-clockwise, negative clockwise.
Returned doubled and unscaled because this is the same quantity as the
orientation determinant, so a caller testing which side of ab the
point c lies on can use it directly without a multiply that would
only add rounding.
Sourcepub fn signed_area(&self) -> Scalar
pub fn signed_area(&self) -> Scalar
Signed area: positive counter-clockwise, negative clockwise.
Trait Implementations§
impl Copy for Triangle2
impl StructuralPartialEq for Triangle2
Auto Trait Implementations§
impl Freeze for Triangle2
impl RefUnwindSafe for Triangle2
impl Send for Triangle2
impl Sync for Triangle2
impl Unpin for Triangle2
impl UnwindSafe for Triangle2
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