pub struct Triangle {
pub v: [usize; 3],
}Expand description
Triangle defined by three vertex indices (CCW orientation).
Fields§
§v: [usize; 3]Implementations§
Source§impl Triangle
impl Triangle
pub fn new(a: usize, b: usize, c: usize) -> Self
Sourcepub fn contains_point(&self, points: &[Point], p: Point) -> bool
pub fn contains_point(&self, points: &[Point], p: Point) -> bool
Check if point is inside triangle (using barycentric coordinates).
Sourcepub fn signed_area(&self, points: &[Point]) -> f64
pub fn signed_area(&self, points: &[Point]) -> f64
Compute triangle area (signed, positive for CCW).
Sourcepub fn circumcircle(&self, points: &[Point]) -> (Point, f64)
pub fn circumcircle(&self, points: &[Point]) -> (Point, f64)
Compute triangle circumcircle (center and radius squared).
Trait Implementations§
impl Copy for Triangle
impl StructuralPartialEq for Triangle
Auto Trait Implementations§
impl Freeze for Triangle
impl RefUnwindSafe for Triangle
impl Send for Triangle
impl Sync for Triangle
impl Unpin for Triangle
impl UnsafeUnpin for Triangle
impl UnwindSafe for Triangle
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