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>
impl<T> Triangle<T>
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>
impl<T> Shape2D for Triangle<T>
Source§type VertexIterator<'a> = IntoIter<Point<T>>
where
T: 'a
type VertexIterator<'a> = IntoIter<Point<T>> where T: 'a
The value type of the shape.
Source§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> Freeze for Triangle<T>where
T: Freeze,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more