Type Alias Point3d

Source
pub type Point3d<T> = Point<T, 3>;
Available on crate feature geom only.
Expand description

A specific position in 3d-space without a size.

Aliased Type§

struct Point3d<T> {
    pub coords: [T; 3],
}

Fields§

§coords: [T; 3]

The D-dimensional coordinates.

Implementations§

Source§

impl<T> Point3d<T>

Source

pub const fn x(self) -> T
where T: Copy,

Returns a copy of the first dimension x.

Source

pub const fn y(self) -> T
where T: Copy,

Returns a copy of the second dimension y.

Source

pub const fn z(self) -> T
where T: Copy,

Returns a copy of the third dimension z.

Source

pub const fn x_ref(&self) -> &T

Returns a shared reference to the first dimension x.

Source

pub const fn y_ref(&self) -> &T

Returns a shared reference to the second dimension y.

Source

pub const fn z_ref(&self) -> &T

Returns a shared reference to the third dimension z.

Source

pub fn x_mut(&mut self) -> &mut T

Returns an exclusive reference to the first dimension x.

Source

pub fn y_mut(&mut self) -> &mut T

Returns an exclusive reference to the second dimension y.

Source

pub fn z_mut(&mut self) -> &mut T

Returns an exclusive reference to the third dimension z.

Source§

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

Source

pub const fn new(coords: [T; D]) -> Self

Returns a new Point from the given coords array.

Source

pub fn into_vector(self) -> Vector<T, D>

Available on crate feature alg only.

Consumes this Point and converts it into a Vector.

Source

pub const fn to_vector(self) -> Vector<T, D>
where T: Copy,

Available on crate feature alg only.

Converts this Point to a Vector, keeping self intact.

Source

pub fn from_vector(v: Vector<T, D>) -> Self

Available on crate feature alg only.

Creates a Point from a Vector.

Source

pub const fn from_vector_const(v: Vector<T, D>) -> Self
where T: Copy,

Available on crate feature alg only.

Creates a Point from a constant Vector.

Source§

impl<const D: usize> Point<i64, D>

Source

pub const fn c_add_vector(self, v: Vector<i64, D>) -> Self

Available on crate features _int_i64 and alg only.

Adds the given vector.

Source§

impl<const D: usize> Point<u32, D>

Source

pub const fn c_add_vector(self, v: Vector<u32, D>) -> Self

Available on crate features _int_u32 and alg only.

Adds the given vector.

Trait Implementations

Source§

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

Source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

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

Source§

const DEFAULT: Self

Returns the compile-time “default value” for a type.
Source§

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

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult<()>

Formats the value using the given formatter. Read more
Source§

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

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

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

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult<()>

Formats the value using the given formatter. Read more
Source§

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

Source§

fn hash<HR: Hasher>(&self, state: &mut HR)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

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

Source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

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

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

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

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

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

Source§

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