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 for Parallelogram<T>
impl<T: PartialEq> PartialEq 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 ==.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> StructuralEq for Parallelogram<T>
impl<T> StructuralPartialEq for Parallelogram<T>
Auto Trait Implementations§
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