pub struct Triangle {
pub a: Point,
pub b: Point,
pub c: Point,
}
Expand description
Triangle
Fields§
§a: Point
vertex a.
b: Point
vertex b.
c: Point
vertex c.
Implementations§
Source§impl Triangle
impl Triangle
Sourcepub const EQUILATERAL: Self
pub const EQUILATERAL: Self
Equilateral Triangle
with the x-axis unit vector as its base.
Sourcepub const fn from_coords(a: (f64, f64), b: (f64, f64), c: (f64, f64)) -> Self
pub const fn from_coords(a: (f64, f64), b: (f64, f64), c: (f64, f64)) -> Self
A new Triangle
from three float vertex coordinates.
Works as a constant Triangle::new
.
Sourcepub fn is_zero_area(&self) -> bool
pub fn is_zero_area(&self) -> bool
Whether this Triangle
has zero area.
Sourcepub fn inscribed_circle(&self) -> Circle
pub fn inscribed_circle(&self) -> Circle
Sourcepub fn circumscribed_circle(&self) -> Circle
pub fn circumscribed_circle(&self) -> Circle
Trait Implementations§
Source§impl Shape for Triangle
impl Shape for Triangle
Source§type PathElementsIter<'iter> = TrianglePathIter
type PathElementsIter<'iter> = TrianglePathIter
The iterator returned by the
path_elements
method.Source§fn path_elements(&self, _tolerance: f64) -> TrianglePathIter
fn path_elements(&self, _tolerance: f64) -> TrianglePathIter
Source§fn bounding_box(&self) -> Rect
fn bounding_box(&self) -> Rect
The smallest rectangle that encloses the shape.
Source§fn into_path(self, tolerance: f64) -> BezPathwhere
Self: Sized,
fn into_path(self, tolerance: f64) -> BezPathwhere
Self: Sized,
Convert into a Bézier path. Read more
Source§fn path_segments(&self, tolerance: f64) -> Segments<Self::PathElementsIter<'_>> ⓘ
fn path_segments(&self, tolerance: f64) -> Segments<Self::PathElementsIter<'_>> ⓘ
Source§fn as_rounded_rect(&self) -> Option<RoundedRect>
fn as_rounded_rect(&self) -> Option<RoundedRect>
If the shape is a rounded rectangle, make it available.
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 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