[][src]Struct aljabar::Point

#[repr(transparent)]pub struct Point<T, const N: usize>(_);

A point in space.

Points are far less flexible and useful than vectors and are used to express the purpose or meaning of a variable through its type.

Points can be moved through space by adding or subtracting vectors from them.

The only mathematical operator supported between two points is subtraction, which results in the vector between the two points.

Points can be freely converted to and from vectors via From.

Implementations

impl<T, const N: usize> Point<T, { N }>[src]

pub fn from_vec(v: Vector<T, { N }>) -> Self[src]

Convenience method for converting from vector.

pub fn to_vec(self) -> Vector<T, { N }>[src]

Convenience method for converting from vector.

impl<T, const N: usize> Point<T, { N }> where
    T: Clone
[src]

pub fn x(&self) -> T[src]

Alias for .get(0).clone().

Panics

When N = 0.

pub fn y(&self) -> T[src]

Alias for .get(1).clone().

Panics

When N < 2.

pub fn z(&self) -> T[src]

Alias for .get(2).clone().

Panics

When N < 3.

pub fn w(&self) -> T[src]

Alias for .get(3).clone().

Panics

When N < 4.

Trait Implementations

impl<A, B, const N: usize> Add<Vector<B, N>> for Point<A, { N }> where
    A: Add<B>, 
[src]

type Output = Point<<A as Add<B>>::Output, { N }>

The resulting type after applying the + operator.

impl<T, const N: usize> Clone for Point<T, { N }> where
    T: Clone
[src]

impl<T, const N: usize> Copy for Point<T, { N }> where
    T: Copy
[src]

impl<T, const N: usize> Debug for Point<T, { N }> where
    T: Debug
[src]

impl<T, const N: usize> Deref for Point<T, { N }>[src]

type Target = [T; N]

The resulting type after dereferencing.

impl<T, const N: usize> DerefMut for Point<T, { N }>[src]

impl<'de, T, const N: usize> Deserialize<'de> for Point<T, { N }> where
    T: Deserialize<'de>, 
[src]

impl<T, const N: usize> Distribution<Point<T, N>> for Standard where
    Standard: Distribution<T>, 
[src]

impl<T, const N: usize> Eq for Point<T, { N }> where
    T: Eq
[src]

impl<T, const N: usize> From<[T; N]> for Point<T, { N }>[src]

impl<T, const N: usize> From<Vector<T, N>> for Point<T, { N }>[src]

impl<T, const N: usize> Hash for Point<T, { N }> where
    T: Hash
[src]

impl<T, const N: usize> Into<[T; N]> for Point<T, { N }>[src]

impl<T, const N: usize> IntoIterator for Point<T, { N }>[src]

type Item = T

The type of the elements being iterated over.

type IntoIter = ArrayIter<T, { N }>

Which kind of iterator are we turning this into?

impl<A, B, RHS, const N: usize> PartialEq<RHS> for Point<A, { N }> where
    RHS: Deref<Target = [B; N]>,
    A: PartialEq<B>, 
[src]

impl<T, const N: usize> Serialize for Point<T, { N }> where
    T: Serialize
[src]

impl<A, B, const N: usize> Sub<Point<B, N>> for Point<A, { N }> where
    A: Sub<B>, 
[src]

type Output = Vector<<A as Sub<B>>::Output, { N }>

The resulting type after applying the - operator.

impl<A, B, const N: usize> Sub<Vector<B, N>> for Point<A, { N }> where
    A: Sub<B>, 
[src]

type Output = Point<<A as Sub<B>>::Output, { N }>

The resulting type after applying the - operator.

Auto Trait Implementations

impl<T, const N: usize> RefUnwindSafe for Point<T, N> where
    T: RefUnwindSafe

impl<T, const N: usize> Send for Point<T, N> where
    T: Send

impl<T, const N: usize> Sync for Point<T, N> where
    T: Sync

impl<T, const N: usize> Unpin for Point<T, N> where
    T: Unpin

impl<T, const N: usize> UnwindSafe for Point<T, N> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,