Struct shape_core::Parallelogram
source · #[repr(C)]pub struct Parallelogram<T> {
pub anchor: Point<T>,
pub side: (Point<T>, Point<T>),
}
Expand description
Fields§
§anchor: Point<T>
The origin points of the parallelogram.
side: (Point<T>, Point<T>)
The side length of the parallelogram.
Implementations§
source§impl<T> Parallelogram<T>
impl<T> Parallelogram<T>
source§impl<T> Parallelogram<T>where
T: Clone + Num,
impl<T> Parallelogram<T>where T: Clone + Num,
pub fn vertexes(&self) -> Vec<Point<T>>
pub fn side_edges(&self) -> (Line<T>, Line<T>)
sourcepub fn is_diamond(&self) -> boolwhere
T: Float,
pub fn is_diamond(&self) -> boolwhere T: Float,
Check if the parallelogram is a diamond
sourcepub fn is_rectangle(&self) -> bool
pub fn is_rectangle(&self) -> bool
Check if the parallelogram is a rectangle_2d
Trait Implementations§
source§impl<T: Clone> Clone for Parallelogram<T>
impl<T: Clone> Clone for Parallelogram<T>
source§fn clone(&self) -> Parallelogram<T>
fn clone(&self) -> Parallelogram<T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<T: Debug> Debug for Parallelogram<T>
impl<T: Debug> Debug for Parallelogram<T>
source§impl<'de, T> Deserialize<'de> for Parallelogram<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for Parallelogram<T>where T: Deserialize<'de>,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<T: Hash> Hash for Parallelogram<T>
impl<T: Hash> Hash for Parallelogram<T>
source§impl<T: PartialEq> PartialEq<Parallelogram<T>> for Parallelogram<T>
impl<T: PartialEq> PartialEq<Parallelogram<T>> for Parallelogram<T>
source§fn eq(&self, other: &Parallelogram<T>) -> bool
fn eq(&self, other: &Parallelogram<T>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.