#[repr(C)]pub struct HomogeneousVector<T, U> {
pub x: T,
pub y: T,
pub z: T,
pub w: T,
/* private fields */
}
Expand description
Homogeneous vector in 3D space.
Fields§
§x: T
§y: T
§z: T
§w: T
Implementations§
Source§impl<T, U> HomogeneousVector<T, U>
impl<T, U> HomogeneousVector<T, U>
Source§impl<T: Copy + Div<T, Output = T> + Zero + PartialOrd, U> HomogeneousVector<T, U>
impl<T: Copy + Div<T, Output = T> + Zero + PartialOrd, U> HomogeneousVector<T, U>
Sourcepub fn to_point2d(self) -> Option<Point2D<T, U>>
pub fn to_point2d(self) -> Option<Point2D<T, U>>
Convert into Cartesian 2D point.
Returns None if the point is on or behind the W=0 hemisphere.
Sourcepub fn to_point3d(self) -> Option<Point3D<T, U>>
pub fn to_point3d(self) -> Option<Point3D<T, U>>
Convert into Cartesian 3D point.
Returns None if the point is on or behind the W=0 hemisphere.
Trait Implementations§
Source§impl<T: Clone, U> Clone for HomogeneousVector<T, U>
impl<T: Clone, U> Clone for HomogeneousVector<T, U>
Source§impl<T: Debug, U> Debug for HomogeneousVector<T, U>
impl<T: Debug, U> Debug for HomogeneousVector<T, U>
Source§impl<'de, T, U> Deserialize<'de> for HomogeneousVector<T, U>where
T: Deserialize<'de>,
impl<'de, T, U> Deserialize<'de> for HomogeneousVector<T, U>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, U> Hash for HomogeneousVector<T, U>where
T: Hash,
impl<T, U> Hash for HomogeneousVector<T, U>where
T: Hash,
Source§impl<T, U> PartialEq for HomogeneousVector<T, U>where
T: PartialEq,
impl<T, U> PartialEq for HomogeneousVector<T, U>where
T: PartialEq,
Source§impl<T, U> Serialize for HomogeneousVector<T, U>where
T: Serialize,
impl<T, U> Serialize for HomogeneousVector<T, U>where
T: Serialize,
impl<T: Copy, U> Copy for HomogeneousVector<T, U>
impl<T, U> Eq for HomogeneousVector<T, U>where
T: Eq,
Auto Trait Implementations§
impl<T, U> Freeze for HomogeneousVector<T, U>where
T: Freeze,
impl<T, U> RefUnwindSafe for HomogeneousVector<T, U>where
T: RefUnwindSafe,
U: RefUnwindSafe,
impl<T, U> Send for HomogeneousVector<T, U>
impl<T, U> Sync for HomogeneousVector<T, U>
impl<T, U> Unpin for HomogeneousVector<T, U>
impl<T, U> UnwindSafe for HomogeneousVector<T, U>where
T: UnwindSafe,
U: 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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)