Struct nannou::prelude::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]

[src]

A unit vector in the x direction.

[src]

A unit vector in the y direction.

[src]

The perpendicular dot product of the vector and other.

[src]

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

impl<S> Vector2<S>
[src]

[src]

Construct a new vector, using the provided values.

[src]

Perform the given operation on each field in the vector, returning a new point constructed from the operations.

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

[src]

Component-wise casting to another type.

Trait Implementations

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

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

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

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

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

The resulting type after applying the - operator.

[src]

Performs the - operation.

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

The resulting type after applying the - operator.

[src]

Performs the - operation.

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

The resulting type after applying the - operator.

[src]

Performs the - operation.

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

The resulting type after applying the - operator.

[src]

Performs the - operation.

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

The resulting type after applying the - operator.

[src]

Performs the - operation.

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

The resulting type after applying the - operator.

[src]

Performs the - operation.

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

The resulting type after applying the - operator.

[src]

Performs the - operation.

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

The resulting type after applying the - operator.

[src]

Performs the - operation.

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

Important traits for &'a mut [u8]
[src]

Performs the mutable indexing (container[index]) operation.

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

Important traits for &'a mut [u8]
[src]

Performs the mutable indexing (container[index]) operation.

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

Important traits for &'a mut [u8]
[src]

Performs the mutable indexing (container[index]) operation.

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

Important traits for &'a mut [u8]
[src]

Performs the mutable indexing (container[index]) operation.

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

Important traits for &'a mut W
[src]

Performs the mutable indexing (container[index]) operation.

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

Used for specifying relative comparisons.

[src]

The default tolerance to use when testing values that are close together. Read more

[src]

The default relative tolerance for testing values that are far-apart. Read more

[src]

The default ULPs to tolerate when testing values that are far-apart. Read more

[src]

A test for equality that uses a relative comparison if the values are far apart.

[src]

A test for equality that uses units in the last place (ULP) if the values are far apart.

The inverse of ApproxEq::relative_eq.

The inverse of ApproxEq::ulps_eq.

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

[src]

Vector dot (or inner) product.

[src]

Returns the angle between two vectors in radians.

[src]

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

[src]

Returns the squared magnitude. Read more

[src]

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

[src]

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

[src]

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

[src]

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

[src]

Returns the vector projection of the current inner space projected onto the supplied argument. Read more

impl<'a> Mul<&'a Vector2<i64>> for i64
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl Mul<Vector2<f32>> for f32
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl<'a> Mul<&'a Vector2<f32>> for f32
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl Mul<Vector2<i32>> for i32
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

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

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl<'a> Mul<&'a Vector2<u8>> for u8
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

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

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl Mul<Vector2<i8>> for i8
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl<'a> Mul<&'a Vector2<f64>> for f64
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl<'a> Mul<&'a Vector2<i16>> for i16
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl<'a> Mul<&'a Vector2<usize>> for usize
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

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

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl Mul<Vector2<isize>> for isize
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl<'a> Mul<&'a Vector2<i8>> for i8
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

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

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl Mul<Vector2<i64>> for i64
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl<'a> Mul<&'a Vector2<u32>> for u32
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl Mul<Vector2<u32>> for u32
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

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

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl Mul<Vector2<i16>> for i16
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl<'a> Mul<&'a Vector2<u64>> for u64
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

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

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl Mul<Vector2<u8>> for u8
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl Mul<Vector2<f64>> for f64
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl<'a> Mul<&'a Vector2<u16>> for u16
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl Mul<Vector2<u16>> for u16
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl<'a> Mul<&'a Vector2<i32>> for i32
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl Mul<Vector2<u64>> for u64
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl Mul<Vector2<usize>> for usize
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl<'a> Mul<&'a Vector2<isize>> for isize
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

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

[src]

Performs the %= operation.

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl Rem<Vector2<f32>> for f32
[src]

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl<'a> Rem<&'a Vector2<i8>> for i8
[src]

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl<'a> Rem<&'a Vector2<i16>> for i16
[src]

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl Rem<Vector2<u8>> for u8
[src]

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl<'a> Rem<&'a Vector2<f32>> for f32
[src]

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl<'a> Rem<&'a Vector2<u16>> for u16
[src]

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl Rem<Vector2<usize>> for usize
[src]

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl Rem<Vector2<i64>> for i64
[src]

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl<'a> Rem<&'a Vector2<u32>> for u32
[src]

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl Rem<Vector2<u16>> for u16
[src]

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl Rem<Vector2<i32>> for i32
[src]

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl<'a> Rem<&'a Vector2<u8>> for u8
[src]

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl<'a> Rem<&'a Vector2<i64>> for i64
[src]

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl<'a> Rem<&'a Vector2<u64>> for u64
[src]

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl Rem<Vector2<isize>> for isize
[src]

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl Rem<Vector2<i8>> for i8
[src]

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl Rem<Vector2<f64>> for f64
[src]

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl Rem<Vector2<i16>> for i16
[src]

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl<'a> Rem<&'a Vector2<isize>> for isize
[src]

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl Rem<Vector2<u64>> for u64
[src]

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl Rem<Vector2<u32>> for u32
[src]

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl<'a> Rem<&'a Vector2<f64>> for f64
[src]

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl<'a> Rem<&'a Vector2<i32>> for i32
[src]

The resulting type after applying the % operator.

[src]

Performs the % operation.

impl<'a> Rem<&'a Vector2<usize>> for usize
[src]

The resulting type after applying the % operator.

[src]

Performs the % operation.

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

The resulting type after applying the % operator.

[src]

Performs the % operation.

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

The associated scalar.

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

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

[src]

Performs the += operation.

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

[src]

Performs the += operation.

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

[src]

Performs the *= operation.

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

[src]

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

[src]

This method tests for !=.

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

[src]

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

[src]

Returns true if self is equal to the additive identity.

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

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

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

The resulting type after applying the + operator.

[src]

Performs the + operation.

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

The resulting type after applying the + operator.

[src]

Performs the + operation.

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

The resulting type after applying the + operator.

[src]

Performs the + operation.

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

The resulting type after applying the + operator.

[src]

Performs the + operation.

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

The resulting type after applying the + operator.

[src]

Performs the + operation.

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

The resulting type after applying the + operator.

[src]

Performs the + operation.

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

The resulting type after applying the + operator.

[src]

Performs the + operation.

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

The resulting type after applying the + operator.

[src]

Performs the + operation.

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

[src]

Get the number of elements in the array type Read more

[src]

Construct a vector from a single value, replicating it. Read more

[src]

The sum of the elements of the array.

[src]

The product of the elements of the array.

[src]

Get the pointer to the first element of the array.

[src]

Get a mutable pointer to the first element of the array.

[src]

Swap the elements at indices i and j in-place.

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

The returned type after indexing.

Important traits for &'a mut W
[src]

Performs the indexing (container[index]) operation.

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

The returned type after indexing.

Important traits for &'a mut [u8]
[src]

Performs the indexing (container[index]) operation.

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

The returned type after indexing.

Important traits for &'a mut [u8]
[src]

Performs the indexing (container[index]) operation.

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

The returned type after indexing.

Important traits for &'a mut [u8]
[src]

Performs the indexing (container[index]) operation.

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

The returned type after indexing.

Important traits for &'a mut [u8]
[src]

Performs the indexing (container[index]) operation.

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

The metric to be returned by the distance function.

[src]

Returns the squared distance. Read more

[src]

The distance between two values.

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

[src]

returns the smallest finite number this type can represent

[src]

returns the largest finite number this type can represent

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

[src]

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

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

[src]

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

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

[src]

Performs the -= operation.

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

[src]

Performs the -= operation.

impl<'a> Div<&'a Vector2<u32>> for u32
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl Div<Vector2<i8>> for i8
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl Div<Vector2<u8>> for u8
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl Div<Vector2<i16>> for i16
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl Div<Vector2<f64>> for f64
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl<'a> Div<&'a Vector2<u64>> for u64
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl<'a> Div<&'a Vector2<f32>> for f32
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl<'a> Div<&'a Vector2<i8>> for i8
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl<'a> Div<&'a Vector2<f64>> for f64
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl Div<Vector2<u16>> for u16
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl<'a> Div<&'a Vector2<i64>> for i64
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

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

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl<'a> Div<&'a Vector2<u8>> for u8
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl<'a> Div<&'a Vector2<i16>> for i16
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl<'a> Div<&'a Vector2<usize>> for usize
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl Div<Vector2<f32>> for f32
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl<'a> Div<&'a Vector2<u16>> for u16
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl Div<Vector2<usize>> for usize
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl Div<Vector2<u64>> for u64
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl<'a> Div<&'a Vector2<i32>> for i32
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl Div<Vector2<i64>> for i64
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

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

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl Div<Vector2<u32>> for u32
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl<'a> Div<&'a Vector2<isize>> for isize
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl Div<Vector2<i32>> for i32
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

impl Div<Vector2<isize>> for isize
[src]

The resulting type after applying the / operator.

[src]

Performs the / operation.

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

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

[src]

Performs the /= operation.

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

[src]

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

1.3.0
[src]

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

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

[src]

Generates a random instance of this type using the specified source of randomness. Read more

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

impl<'de, S> Deserialize<'de> for Vector2<S> where
    S: Deserialize<'de>, 
[src]

[src]

Deserialize this value from the given Serde deserializer. Read more

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

[src]

Serialize this value into the given Serde serializer. Read more

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

[src]

Formats the value using the given formatter. Read more

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

The resulting type after applying the - operator.

[src]

Performs the unary - operation.

Auto Trait Implementations

impl<S> Send for Vector2<S> where
    S: Send

impl<S> Sync for Vector2<S> where
    S: Sync