Struct shape_core::Triangle
source · pub struct Triangle<T> {
pub a: Point<T>,
pub b: Point<T>,
pub c: Point<T>,
}
Expand description
Fields§
§a: Point<T>
The 1st vertex of the triangle.
b: Point<T>
The 2nd vertex of the triangle.
c: Point<T>
The 3rd vertex of the triangle.
Implementations§
source§impl<T> Triangle<T>where
T: Clone + AddAssign + Real,
impl<T> Triangle<T>where T: Clone + AddAssign + Real,
sourcepub fn is_congruent(&self) -> bool
pub fn is_congruent(&self) -> bool
Returns true if the triangle is equilateral.
sourcepub fn is_isosceles(&self) -> bool
pub fn is_isosceles(&self) -> bool
Returns true if the triangle is equilateral.
sourcepub fn inscribed_circle(&self) -> Circle<T>
pub fn inscribed_circle(&self) -> Circle<T>
Get the inscribed circle of the triangles
sourcepub fn circumscribed_circle(&self) -> Circle<T>
pub fn circumscribed_circle(&self) -> Circle<T>
Get the circumscribed circle of the triangles.
Trait Implementations§
source§impl<T: Float> EuclideanDistance<T, Triangle<T>> for Point<T>
impl<T: Float> EuclideanDistance<T, Triangle<T>> for Point<T>
fn euclidean_distance(&self, rhs: &Triangle<T>) -> T
source§fn euclidean_squared(&self, rhs: &Triangle<T>) -> T
fn euclidean_squared(&self, rhs: &Triangle<T>) -> T
It is especially suitable when only the length needs to be compared Read more
source§impl<T> Projective<T> for Triangle<T>where
T: Float,
impl<T> Projective<T> for Triangle<T>where T: Float,
source§impl<T> Shape2D for Triangle<T>where
T: Clone + PartialOrd + Num,
impl<T> Shape2D for Triangle<T>where T: Clone + PartialOrd + Num,
§type VertexIterator<'a> = IntoIter<Point<T>>
where
T: 'a
type VertexIterator<'a> = IntoIter<Point<T>> where T: 'a
The value type of the shape.
§type LineIterator<'a> = IntoIter<Line<T>>
where
T: 'a
type LineIterator<'a> = IntoIter<Line<T>> where T: 'a
The value type of the shape.
source§fn vertices<'a>(&'a self, _: usize) -> Self::VertexIterator<'a>
fn vertices<'a>(&'a self, _: usize) -> Self::VertexIterator<'a>
Returns the owned vertices of the shape. Read more
source§fn edges<'a>(&'a self, _: usize) -> Self::LineIterator<'a>
fn edges<'a>(&'a self, _: usize) -> Self::LineIterator<'a>
Returns the owned edges of the shape.
Auto Trait Implementations§
impl<T> RefUnwindSafe for Triangle<T>where T: RefUnwindSafe,
impl<T> Send for Triangle<T>where T: Send,
impl<T> Sync for Triangle<T>where T: Sync,
impl<T> Unpin for Triangle<T>where T: Unpin,
impl<T> UnwindSafe for Triangle<T>where T: 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