Struct rgeometry::data::Vector[][src]

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

Implementations

impl<T, const N: usize> Vector<T, N> where
    T: Clone
[src]

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

pub fn squared_magnitude(&self) -> T where
    T: Zero + AddAssign,
    &'a T: Sub<&'a T, Output = T> + Mul<&'a T, Output = T>, 
[src]

impl<T> Vector<T, 2>[src]

pub fn ccw_cmp_around(&self, p: &Vector<T, 2>, q: &Vector<T, 2>) -> Ordering where
    T: NumRef + Clone + Ord + Neg<Output = T> + Zero + One,
    &'a T: Mul<Output = T> + Neg<Output = T>, 
[src]

pub fn ccw_cmp_around_with(
    &self,
    z: &Vector<T, 2>,
    p: &Vector<T, 2>,
    q: &Vector<T, 2>
) -> Ordering where
    T: NumRef + Clone + Ord + Neg<Output = T>,
    &'a T: Mul<Output = T> + Neg<Output = T>, 
[src]

pub fn sort_around(pts: &mut Vec<Vector<T, 2>>) where
    T: NumRef + Ord + Clone + Neg<Output = T> + Zero + One
[src]

Trait Implementations

impl<T, const N: usize> Add<&'_ Vector<T, N>> for Point<T, N> where
    &'a T: Add<&'a T, Output = T>, 
[src]

type Output = Point<T, N>

The resulting type after applying the + operator.

fn add(self: Point<T, N>, other: &Vector<T, N>) -> Self::Output[src]

Performs the + operation. Read more

impl<'a, 'b, T, const N: usize> Add<&'a Vector<T, N>> for &'b Point<T, N> where
    &'c T: Add<&'c T, Output = T>, 
[src]

type Output = Point<T, N>

The resulting type after applying the + operator.

fn add(self: &'b Point<T, N>, other: &'a Vector<T, N>) -> Self::Output[src]

Performs the + operation. Read more

impl<'a, 'b, T, const N: usize> Add<&'b Vector<T, N>> for &'a Vector<T, N> where
    T: NumOps + Clone
[src]

type Output = Vector<T, N>

The resulting type after applying the + operator.

fn add(self, other: &Vector<T, N>) -> Self::Output[src]

Performs the + operation. Read more

impl<T, const N: usize> Add<Vector<T, N>> for Point<T, N> where
    &'a T: Add<&'a T, Output = T>, 
[src]

type Output = Point<T, N>

The resulting type after applying the + operator.

fn add(self: Point<T, N>, other: Vector<T, N>) -> Self::Output[src]

Performs the + operation. Read more

impl<T, const N: usize> Add<Vector<T, N>> for Vector<T, N> where
    T: NumOps + Clone
[src]

type Output = Vector<T, N>

The resulting type after applying the + operator.

fn add(self: Vector<T, N>, other: Vector<T, N>) -> Self::Output[src]

Performs the + operation. Read more

impl<T, const N: usize> AddAssign<&'_ Vector<T, N>> for Point<T, N> where
    T: AddAssign<&'a T>, 
[src]

fn add_assign(&mut self, other: &Vector<T, N>)[src]

Performs the += operation. Read more

impl<T, const N: usize> AddAssign<Vector<T, N>> for Point<T, N> where
    T: AddAssign<&'a T>, 
[src]

fn add_assign(&mut self, other: Vector<T, N>)[src]

Performs the += operation. Read more

impl<T, const N: usize> AddAssign<Vector<T, N>> for Vector<T, N> where
    T: NumOps + Clone + AddAssign
[src]

fn add_assign(&mut self, other: Vector<T, N>)[src]

Performs the += operation. Read more

impl<T: Clone, const N: usize> Clone for Vector<T, N>[src]

fn clone(&self) -> Vector<T, N>[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<T: Debug, const N: usize> Debug for Vector<T, N>[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl<T, const N: usize> Div<T> for Vector<T, N> where
    T: NumOps + Clone
[src]

type Output = Vector<T, N>

The resulting type after applying the / operator.

fn div(self: Vector<T, N>, other: T) -> Self::Output[src]

Performs the / operation. Read more

impl<'a, T, const N: usize> From<&'a Point<T, N>> for &'a Vector<T, N>[src]

fn from(point: &Point<T, N>) -> &Vector<T, N>[src]

Performs the conversion.

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

fn from(point: Point<T, N>) -> Vector<T, N>[src]

Performs the conversion.

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

fn from(vector: Vector<T, N>) -> Point<T, N>[src]

Performs the conversion.

impl<T, const N: usize> Index<usize> for Vector<T, N>[src]

type Output = T

The returned type after indexing.

fn index(&self, index: usize) -> &T[src]

Performs the indexing (container[index]) operation. Read more

impl<'a, T, const N: usize> Mul<&'a Vector<T, N>> for Transform<T, N> where
    T: TransformScalar, 
[src]

type Output = Vector<T, N>

The resulting type after applying the * operator.

fn mul(self, other: &Vector<T, N>) -> Vector<T, N>[src]

Performs the * operation. Read more

impl<'a, 'b, T, const N: usize> Mul<&'b Vector<T, N>> for &'a Transform<T, N> where
    T: TransformScalar, 
[src]

type Output = Vector<T, N>

The resulting type after applying the * operator.

fn mul(self, other: &Vector<T, N>) -> Vector<T, N>[src]

Performs the * operation. Read more

impl<T, const N: usize> Mul<T> for Vector<T, N> where
    T: NumOps + Clone
[src]

type Output = Vector<T, N>

The resulting type after applying the * operator.

fn mul(self: Vector<T, N>, other: T) -> Self::Output[src]

Performs the * operation. Read more

impl<'a, T, const N: usize> Mul<Vector<T, N>> for &'a Transform<T, N> where
    T: TransformScalar, 
[src]

type Output = Vector<T, N>

The resulting type after applying the * operator.

fn mul(self, other: Vector<T, N>) -> Vector<T, N>[src]

Performs the * operation. Read more

impl<T, const N: usize> Neg for Vector<T, N> where
    T: NumOps + Neg<Output = T> + Clone
[src]

type Output = Self

The resulting type after applying the - operator.

fn neg(self) -> Self[src]

Performs the unary - operation. Read more

impl<T: Ord, const N: usize> Ord for Vector<T, N>[src]

fn cmp(&self, other: &Vector<T, N>) -> Ordering[src]

This method returns an Ordering between self and other. Read more

#[must_use]
fn max(self, other: Self) -> Self
1.21.0[src]

Compares and returns the maximum of two values. Read more

#[must_use]
fn min(self, other: Self) -> Self
1.21.0[src]

Compares and returns the minimum of two values. Read more

#[must_use]
fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]

Restrict a value to a certain interval. Read more

impl<T: PartialEq, const N: usize> PartialEq<Vector<T, N>> for Vector<T, N>[src]

fn eq(&self, other: &Vector<T, N>) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &Vector<T, N>) -> bool[src]

This method tests for !=.

impl<T: PartialOrd, const N: usize> PartialOrd<Vector<T, N>> for Vector<T, N>[src]

fn partial_cmp(&self, other: &Vector<T, N>) -> Option<Ordering>[src]

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

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<'a, 'b, T, const N: usize> Sub<&'a Vector<T, N>> for &'b Vector<T, N> where
    T: Sub<T, Output = T> + Clone
[src]

type Output = Vector<T, N>

The resulting type after applying the - operator.

fn sub(self: &'b Vector<T, N>, other: &'a Vector<T, N>) -> Self::Output[src]

Performs the - operation. Read more

impl<T, const N: usize> Sum<Vector<T, N>> for Vector<T, N> where
    T: NumOps + Zero + AddAssign + Clone
[src]

fn sum<I>(iter: I) -> Vector<T, N> where
    I: Iterator<Item = Vector<T, N>>, 
[src]

Method which takes an iterator and generates Self from the elements by “summing up” the items. Read more

impl<'a, const N: usize> TryFrom<Vector<f64, N>> for Vector<BigRational, N>[src]

type Error = ()

The type returned in the event of a conversion error.

fn try_from(point: Vector<f64, N>) -> Result<Vector<BigRational, N>, ()>[src]

Performs the conversion.

impl<T, const N: usize> Zero for Vector<T, N> where
    T: NumOps + Zero + Clone
[src]

fn zero() -> Vector<T, N>[src]

Returns the additive identity element of Self, 0. Read more

fn is_zero(&self) -> bool[src]

Returns true if self is equal to the additive identity.

fn set_zero(&mut self)[src]

Sets self to the additive identity element of Self, 0.

impl<T: Eq, const N: usize> Eq for Vector<T, N>[src]

impl<T, const N: usize> StructuralEq for Vector<T, N>[src]

impl<T, const N: usize> StructuralPartialEq for Vector<T, N>[src]

Auto Trait Implementations

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

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

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

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

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

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

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

Immutably borrows from an owned value. Read more

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

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

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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

type Owned = T

The resulting type after obtaining ownership.

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

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

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

pub fn vzip(self) -> V