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<T, Const<D>>>::Buffer>,
}

Fields§

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

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> AffineSpace for Point<T, D>
where T: Scalar + Field,

§

type Translation = Matrix<T, Const<D>, Const<1>, ArrayStorage<T, D, 1>>

The associated vector space.
source§

fn translate_by(&self, t: &Self::Translation) -> Self

Same as *self + *t. Applies the additive group action of this affine space’s associated vector space on self.
source§

fn subtract(&self, right: &Self) -> Self::Translation

Same as *self - *other. Returns the unique element v of the associated vector space such that self = right + v.
source§

impl<T> AsMut<Point2<T>> for Point<T, 2>
where T: Scalar,

source§

fn as_mut(&mut self) -> &mut Point2<T>

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<T> AsMut<Point3<T>> for Point<T, 3>
where T: Scalar,

source§

fn as_mut(&mut self) -> &mut Point3<T>

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<T> AsRef<Point2<T>> for Point<T, 2>
where T: Scalar,

source§

fn as_ref(&self) -> &Point2<T>

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<T> AsRef<Point3<T>> for Point<T, 3>
where T: Scalar,

source§

fn as_ref(&self) -> &Point3<T>

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<T: RealField + RealField, const D: usize> EuclideanSpace for Point<T, D>

§

type Coordinates = Matrix<T, Const<D>, Const<1>, ArrayStorage<T, D, 1>>

The underlying finite vector space.
§

type RealField = T

The underlying reals.
source§

fn origin() -> Self

The preferred origin of this euclidean space. Read more
source§

fn coordinates(&self) -> Self::Coordinates

The coordinates of this point, i.e., the translation from the origin.
source§

fn from_coordinates(coords: Self::Coordinates) -> Self

Builds a point from its coordinates relative to the origin.
source§

fn scale_by(&self, n: T) -> Self

Multiplies the distance of this point to Self::origin() by s. Read more
source§

fn distance_squared(&self, b: &Self) -> Self::RealField

The distance between two points.
source§

fn distance(&self, b: &Self) -> Self::RealField

The distance between two points.
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> From<Point2<T>> for Point<T, 2>
where T: Scalar,

source§

fn from(p: Point2<T>) -> Self

Converts to this type from the input type.
source§

impl<T> From<Point3<T>> for Point<T, 3>
where T: Scalar,

source§

fn from(p: Point3<T>) -> Self

Converts to this type from the input type.
source§

impl<T> Into<Point2<T>> for Point<T, 2>
where T: Scalar,

source§

fn into(self) -> Point2<T>

Converts this type into the (usually inferred) input type.
source§

impl<T> Into<Point3<T>> for Point<T, 3>
where T: Scalar,

source§

fn into(self) -> Point3<T>

Converts this type into the (usually inferred) input type.
source§

impl<T, const D: usize> JoinSemilattice for Point<T, D>

source§

fn join(&self, other: &Self) -> Self

Returns the join (aka. supremum) of two values.
source§

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

source§

fn meet_join(&self, other: &Self) -> (Self, Self)

Returns the infimum and the supremum simultaneously.
source§

fn partial_min<'a>(&'a self, other: &'a Self) -> Option<&'a Self>

Return the minimum of self and other if they are comparable.
source§

fn partial_max<'a>(&'a self, other: &'a Self) -> Option<&'a Self>

Return the maximum of self and other if they are comparable.
source§

fn partial_sort2<'a>(&'a self, other: &'a Self) -> Option<(&'a Self, &'a Self)>

Sorts two values in increasing order using a partial ordering.
source§

fn partial_clamp<'a>(&'a self, min: &'a Self, max: &'a Self) -> Option<&'a Self>

Clamp value between min and max. Returns None if value is not comparable to min or max.
source§

impl<T, const D: usize> MeetSemilattice for Point<T, D>

source§

fn meet(&self, other: &Self) -> Self

Returns the meet (aka. infimum) of two values.
source§

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

§

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 lanes() -> usize

The number of lanes of this SIMD value.
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.
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.
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