#[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>
impl<T> Parallelogram<T>
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 duplicate 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 for Parallelogram<T>
impl<T: PartialEq> PartialEq for Parallelogram<T>
Source§impl<T> Serialize for Parallelogram<T>where
T: Serialize,
impl<T> Serialize for Parallelogram<T>where
T: Serialize,
impl<T: Copy> Copy for Parallelogram<T>
impl<T: Eq> Eq for Parallelogram<T>
impl<T> StructuralPartialEq for Parallelogram<T>
Auto Trait Implementations§
impl<T> Freeze for Parallelogram<T>where
T: Freeze,
impl<T> RefUnwindSafe for Parallelogram<T>where
T: RefUnwindSafe,
impl<T> Send for Parallelogram<T>where
T: Send,
impl<T> Sync for Parallelogram<T>where
T: Sync,
impl<T> Unpin for Parallelogram<T>where
T: Unpin,
impl<T> UnwindSafe for Parallelogram<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