Struct spectra::linear::Vector2 [] [src]

#[repr(C)]
pub struct Vector2<S> { pub x: S, pub y: S, }

A 2-dimensional vector.

This type is marked as #[repr(C)].

Fields

The x component of the vector.

The y component of the vector.

Methods

impl<S> Vector2<S> where
    S: BaseNum
[src]

A unit vector in the x direction.

A unit vector in the y direction.

The perpendicular dot product of the vector and other.

Create a Vector3, using the x and y values from this vector, and the provided z.

impl<S> Vector2<S>
[src]

Construct a new vector, using the provided values.

impl<S> Vector2<S> where
    S: Copy + NumCast
[src]

Component-wise casting to another type.

Trait Implementations

impl<S> Index<RangeTo<usize>> for Vector2<S>
[src]

impl<S> Index<RangeFull> for Vector2<S>
[src]

impl<S> Index<usize> for Vector2<S>
[src]

impl<S> Index<Range<usize>> for Vector2<S>
[src]

impl<S> Index<RangeFrom<usize>> for Vector2<S>
[src]

impl<S> Clone for Vector2<S> where
    S: Clone
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<S> MetricSpace for Vector2<S> where
    S: BaseFloat
[src]

impl<S> Zero for Vector2<S> where
    S: BaseNum
[src]

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

Returns true if self is equal to the additive identity.

impl<S> Into<[S; 2]> for Vector2<S>
[src]

Performs the conversion.

impl<S> Into<(S, S)> for Vector2<S>
[src]

Performs the conversion.

impl<S> AsRef<[S; 2]> for Vector2<S>
[src]

Performs the conversion.

impl<S> AsRef<(S, S)> for Vector2<S>
[src]

Performs the conversion.

impl<S> Copy for Vector2<S> where
    S: Copy
[src]

impl<'a, S> Add<Vector2<S>> for &'a Vector2<S> where
    S: BaseNum
[src]

The resulting type after applying the + operator

The method for the + operator

impl<S> Add<Vector2<S>> for Vector2<S> where
    S: BaseNum
[src]

The resulting type after applying the + operator

The method for the + operator

impl<'a, S> Add<&'a Vector2<S>> for Vector2<S> where
    S: BaseNum
[src]

The resulting type after applying the + operator

The method for the + operator

impl<'a, 'b, S> Add<&'a Vector2<S>> for &'b Vector2<S> where
    S: BaseNum
[src]

The resulting type after applying the + operator

The method for the + operator

impl<S> Array for Vector2<S> where
    S: Copy
[src]

impl<S> Div<S> for Vector2<S> where
    S: BaseNum
[src]

The resulting type after applying the / operator

The method for the / operator

impl<'a, S> Div<S> for &'a Vector2<S> where
    S: BaseNum
[src]

The resulting type after applying the / operator

The method for the / operator

impl<'a, S> Rem<S> for &'a Vector2<S> where
    S: BaseNum
[src]

impl<S> Rem<S> for Vector2<S> where
    S: BaseNum
[src]

impl<S> ApproxEq for Vector2<S> where
    S: BaseFloat
[src]

impl<'a, S> Mul<S> for &'a Vector2<S> where
    S: BaseNum
[src]

The resulting type after applying the * operator

The method for the * operator

impl<S> Mul<S> for Vector2<S> where
    S: BaseNum
[src]

The resulting type after applying the * operator

The method for the * operator

impl<S> InnerSpace for Vector2<S> where
    S: BaseFloat
[src]

Vector dot (or inner) product.

Returns the angle between two vectors in radians.

Returns true if the vector is perpendicular (at right angles) to the other vector. Read more

Returns the squared magnitude. Read more

The distance from the tail to the tip of the vector.

Returns a vector with the same direction, but with a magnitude of 1.

Returns a vector with the same direction and a given magnitude.

Returns the result of linearly interpolating the magnitude of the vector towards the magnitude of other by the specified amount. Read more

impl<S> IndexMut<Range<usize>> for Vector2<S>
[src]

impl<S> IndexMut<RangeFull> for Vector2<S>
[src]

impl<S> IndexMut<usize> for Vector2<S>
[src]

impl<S> IndexMut<RangeTo<usize>> for Vector2<S>
[src]

impl<S> IndexMut<RangeFrom<usize>> for Vector2<S>
[src]

impl<S> VectorSpace for Vector2<S> where
    S: BaseNum
[src]

impl<S> Sum<Vector2<S>> for Vector2<S> where
    S: BaseNum
[src]

impl<'a, S> Sum<&'a Vector2<S>> for Vector2<S> where
    S: 'a + BaseNum
[src]

impl<S> DivAssign<S> for Vector2<S> where
    S: BaseNum + DivAssign<S>, 
[src]

impl<S> PartialEq<Vector2<S>> for Vector2<S> where
    S: PartialEq<S>, 
[src]

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

This method tests for !=.

impl<S> MulAssign<S> for Vector2<S> where
    S: BaseNum + MulAssign<S>, 
[src]

impl<S> AddAssign<Vector2<S>> for Vector2<S> where
    S: BaseNum + AddAssign<S>, 
[src]

impl<'a, S> Sub<&'a Vector2<S>> for Vector2<S> where
    S: BaseNum
[src]

The resulting type after applying the - operator

The method for the - operator

impl<'a, S> Sub<Vector2<S>> for &'a Vector2<S> where
    S: BaseNum
[src]

The resulting type after applying the - operator

The method for the - operator

impl<S> Sub<Vector2<S>> for Vector2<S> where
    S: BaseNum
[src]

The resulting type after applying the - operator

The method for the - operator

impl<'a, 'b, S> Sub<&'a Vector2<S>> for &'b Vector2<S> where
    S: BaseNum
[src]

The resulting type after applying the - operator

The method for the - operator

impl<'a, S> From<&'a [S; 2]> for &'a Vector2<S>
[src]

Performs the conversion.

impl<S> From<(S, S)> for Vector2<S>
[src]

Performs the conversion.

impl<S> From<[S; 2]> for Vector2<S> where
    S: Clone
[src]

Performs the conversion.

impl<'a, S> From<&'a (S, S)> for &'a Vector2<S>
[src]

Performs the conversion.

impl<'a, S> From<&'a mut (S, S)> for &'a mut Vector2<S>
[src]

Performs the conversion.

impl<'a, S> From<&'a mut [S; 2]> for &'a mut Vector2<S>
[src]

Performs the conversion.

impl<S> Rand for Vector2<S> where
    S: BaseFloat + Rand
[src]

impl<S> AsMut<(S, S)> for Vector2<S>
[src]

impl<S> AsMut<[S; 2]> for Vector2<S>
[src]

impl<S> ElementWise<Vector2<S>> for Vector2<S> where
    S: BaseNum
[src]

impl<S> ElementWise<S> for Vector2<S> where
    S: BaseNum
[src]

impl<S> Eq for Vector2<S> where
    S: Eq
[src]

impl<S> RemAssign<S> for Vector2<S> where
    S: BaseNum + RemAssign<S>, 
[src]

impl<S> SubAssign<Vector2<S>> for Vector2<S> where
    S: BaseNum + SubAssign<S>, 
[src]

impl<S> Hash for Vector2<S> where
    S: Hash
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl<S> Debug for Vector2<S> where
    S: Debug
[src]

Formats the value using the given formatter.

impl<S> Neg for Vector2<S> where
    S: Neg<Output = S>, 
[src]