Type Alias nalgebra::geometry::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.
§

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

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

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