nalgebra::geometry

Type Alias Point

Source
pub type Point<T, const D: usize> = OPoint<T, Const<D>>;
Expand description

A point with D elements.

Aliased Type§

struct Point<T, const D: usize> {
    pub coords: Matrix<T, Const<D>, Const<1>, <DefaultAllocator as Allocator<Const<D>>>::Buffer<T>>,
}

Fields§

§coords: Matrix<T, Const<D>, Const<1>, <DefaultAllocator as Allocator<Const<D>>>::Buffer<T>>

The coordinates of this point, i.e., the shift from the origin.

Implementations§

Source§

impl<T: Scalar, const D: usize> Point<T, D>
where Const<D>: ToTypenum,

§Swizzling

Source

pub fn xx(&self) -> Point2<T>
where <Const<D> as ToTypenum>::Typenum: Cmp<U0, Output = Greater>,

Builds a new point from components of self.

Source

pub fn xxx(&self) -> Point3<T>
where <Const<D> as ToTypenum>::Typenum: Cmp<U0, Output = Greater>,

Builds a new point from components of self.

Source

pub fn xy(&self) -> Point2<T>
where <Const<D> as ToTypenum>::Typenum: Cmp<U1, Output = Greater>,

Builds a new point from components of self.

Source

pub fn yx(&self) -> Point2<T>
where <Const<D> as ToTypenum>::Typenum: Cmp<U1, Output = Greater>,

Builds a new point from components of self.

Source

pub fn yy(&self) -> Point2<T>
where <Const<D> as ToTypenum>::Typenum: Cmp<U1, Output = Greater>,

Builds a new point from components of self.

Source

pub fn xxy(&self) -> Point3<T>
where <Const<D> as ToTypenum>::Typenum: Cmp<U1, Output = Greater>,

Builds a new point from components of self.

Source

pub fn xyx(&self) -> Point3<T>
where <Const<D> as ToTypenum>::Typenum: Cmp<U1, Output = Greater>,

Builds a new point from components of self.

Source

pub fn xyy(&self) -> Point3<T>
where <Const<D> as ToTypenum>::Typenum: Cmp<U1, Output = Greater>,

Builds a new point from components of self.

Source

pub fn yxx(&self) -> Point3<T>
where <Const<D> as ToTypenum>::Typenum: Cmp<U1, Output = Greater>,

Builds a new point from components of self.

Source

pub fn yxy(&self) -> Point3<T>
where <Const<D> as ToTypenum>::Typenum: Cmp<U1, Output = Greater>,

Builds a new point from components of self.

Source

pub fn yyx(&self) -> Point3<T>
where <Const<D> as ToTypenum>::Typenum: Cmp<U1, Output = Greater>,

Builds a new point from components of self.

Source

pub fn yyy(&self) -> Point3<T>
where <Const<D> as ToTypenum>::Typenum: Cmp<U1, Output = Greater>,

Builds a new point from components of self.

Source

pub fn xz(&self) -> Point2<T>
where <Const<D> as ToTypenum>::Typenum: Cmp<U2, Output = Greater>,

Builds a new point from components of self.

Source

pub fn yz(&self) -> Point2<T>
where <Const<D> as ToTypenum>::Typenum: Cmp<U2, Output = Greater>,

Builds a new point from components of self.

Source

pub fn zx(&self) -> Point2<T>
where <Const<D> as ToTypenum>::Typenum: Cmp<U2, Output = Greater>,

Builds a new point from components of self.

Source

pub fn zy(&self) -> Point2<T>
where <Const<D> as ToTypenum>::Typenum: Cmp<U2, Output = Greater>,

Builds a new point from components of self.

Source

pub fn zz(&self) -> Point2<T>
where <Const<D> as ToTypenum>::Typenum: Cmp<U2, Output = Greater>,

Builds a new point from components of self.

Source

pub fn xxz(&self) -> Point3<T>
where <Const<D> as ToTypenum>::Typenum: Cmp<U2, Output = Greater>,

Builds a new point from components of self.

Source

pub fn xyz(&self) -> Point3<T>
where <Const<D> as ToTypenum>::Typenum: Cmp<U2, Output = Greater>,

Builds a new point from components of self.

Source

pub fn xzx(&self) -> Point3<T>
where <Const<D> as ToTypenum>::Typenum: Cmp<U2, Output = Greater>,

Builds a new point from components of self.

Source

pub fn xzy(&self) -> Point3<T>
where <Const<D> as ToTypenum>::Typenum: Cmp<U2, Output = Greater>,

Builds a new point from components of self.

Source

pub fn xzz(&self) -> Point3<T>
where <Const<D> as ToTypenum>::Typenum: Cmp<U2, Output = Greater>,

Builds a new point from components of self.

Source

pub fn yxz(&self) -> Point3<T>
where <Const<D> as ToTypenum>::Typenum: Cmp<U2, Output = Greater>,

Builds a new point from components of self.

Source

pub fn yyz(&self) -> Point3<T>
where <Const<D> as ToTypenum>::Typenum: Cmp<U2, Output = Greater>,

Builds a new point from components of self.

Source

pub fn yzx(&self) -> Point3<T>
where <Const<D> as ToTypenum>::Typenum: Cmp<U2, Output = Greater>,

Builds a new point from components of self.

Source

pub fn yzy(&self) -> Point3<T>
where <Const<D> as ToTypenum>::Typenum: Cmp<U2, Output = Greater>,

Builds a new point from components of self.

Source

pub fn yzz(&self) -> Point3<T>
where <Const<D> as ToTypenum>::Typenum: Cmp<U2, Output = Greater>,

Builds a new point from components of self.

Source

pub fn zxx(&self) -> Point3<T>
where <Const<D> as ToTypenum>::Typenum: Cmp<U2, Output = Greater>,

Builds a new point from components of self.

Source

pub fn zxy(&self) -> Point3<T>
where <Const<D> as ToTypenum>::Typenum: Cmp<U2, Output = Greater>,

Builds a new point from components of self.

Source

pub fn zxz(&self) -> Point3<T>
where <Const<D> as ToTypenum>::Typenum: Cmp<U2, Output = Greater>,

Builds a new point from components of self.

Source

pub fn zyx(&self) -> Point3<T>
where <Const<D> as ToTypenum>::Typenum: Cmp<U2, Output = Greater>,

Builds a new point from components of self.

Source

pub fn zyy(&self) -> Point3<T>
where <Const<D> as ToTypenum>::Typenum: Cmp<U2, Output = Greater>,

Builds a new point from components of self.

Source

pub fn zyz(&self) -> Point3<T>
where <Const<D> as ToTypenum>::Typenum: Cmp<U2, Output = Greater>,

Builds a new point from components of self.

Source

pub fn zzx(&self) -> Point3<T>
where <Const<D> as ToTypenum>::Typenum: Cmp<U2, Output = Greater>,

Builds a new point from components of self.

Source

pub fn zzy(&self) -> Point3<T>
where <Const<D> as ToTypenum>::Typenum: Cmp<U2, Output = Greater>,

Builds a new point from components of self.

Source

pub fn zzz(&self) -> Point3<T>
where <Const<D> as ToTypenum>::Typenum: Cmp<U2, Output = Greater>,

Builds a new point from components of self.

Trait Implementations§

Source§

impl<T, const D: usize> From<[OPoint<<T as SimdValue>::Element, Const<D>>; 16]> for Point<T, D>

Source§

fn from(arr: [Point<T::Element, D>; 16]) -> Self

Converts to this type from the input type.
Source§

impl<T, const D: usize> From<[OPoint<<T as SimdValue>::Element, Const<D>>; 2]> for Point<T, D>

Source§

fn from(arr: [Point<T::Element, D>; 2]) -> Self

Converts to this type from the input type.
Source§

impl<T, const D: usize> From<[OPoint<<T as SimdValue>::Element, Const<D>>; 4]> for Point<T, D>

Source§

fn from(arr: [Point<T::Element, D>; 4]) -> Self

Converts to this type from the input type.
Source§

impl<T, const D: usize> From<[OPoint<<T as SimdValue>::Element, Const<D>>; 8]> for Point<T, D>

Source§

fn from(arr: [Point<T::Element, D>; 8]) -> Self

Converts to this type from the input type.
Source§

impl<T: Scalar, const D: usize> From<[T; D]> for Point<T, D>

Source§

fn from(coords: [T; D]) -> Self

Converts to this type from the input type.
Source§

impl<T: Scalar + SimdValue, const D: usize> SimdValue for Point<T, D>
where T::Element: Scalar,

Source§

const LANES: usize = T::LANES

The number of lanes of this SIMD value.
Source§

type Element = OPoint<<T as SimdValue>::Element, Const<D>>

The type of the elements of each lane of this SIMD value.
Source§

type SimdBool = <T as SimdValue>::SimdBool

Type of the result of comparing two SIMD values like self.
Source§

fn splat(val: Self::Element) -> Self

Initializes an SIMD value with each lanes set to val.
Source§

fn extract(&self, i: usize) -> Self::Element

Extracts the i-th lane of self. Read more
Source§

unsafe fn extract_unchecked(&self, i: usize) -> Self::Element

Extracts the i-th lane of self without bound-checking. Read more
Source§

fn replace(&mut self, i: usize, val: Self::Element)

Replaces the i-th lane of self by val. Read more
Source§

unsafe fn replace_unchecked(&mut self, i: usize, val: Self::Element)

Replaces the i-th lane of self by val without bound-checking. Read more
Source§

fn select(self, cond: Self::SimdBool, other: Self) -> Self

Merges self and other depending on the lanes of cond. Read more
Source§

fn map_lanes(self, f: impl Fn(Self::Element) -> Self::Element) -> Self
where Self: Clone,

Applies a function to each lane of self. Read more
Source§

fn zip_map_lanes( self, b: Self, f: impl Fn(Self::Element, Self::Element) -> Self::Element, ) -> Self
where Self: Clone,

Applies a function to each lane of self paired with the corresponding lane of b. Read more