Struct nannou::geom::vector::Vector2 [−][src]
#[repr(C)]pub struct Vector2<S = Default> { pub x: S, pub y: S, }
A 2-dimensional vector.
Fields
x: S
y: S
Methods
impl<S> Vector2<S>
[src]
impl<S> Vector2<S>
pub fn new(x: S, y: S) -> Vector2<S>
[src]
pub fn new(x: S, y: S) -> Vector2<S>
Construct a new vector, using the provided values.
pub fn from_value(scalar: S) -> Vector2<S> where
S: Clone,
[src]
pub fn from_value(scalar: S) -> Vector2<S> where
S: Clone,
Construct a vector using the given value for each field.
pub fn len(&self) -> usize
[src]
pub fn len(&self) -> usize
The length of the vector.
pub fn map<U, F>(self, f: F) -> Vector2<U> where
F: FnMut(S) -> U,
[src]
pub fn map<U, F>(self, f: F) -> Vector2<U> where
F: FnMut(S) -> U,
Perform the given operation on each field in the vector, returning a new vector constructed from the operations.
pub fn zip_map<T, U, F>(self, other: Vector2<T>, f: F) -> Vector2<U> where
F: FnMut(S, T) -> U,
[src]
pub fn zip_map<T, U, F>(self, other: Vector2<T>, f: F) -> Vector2<U> where
F: FnMut(S, T) -> U,
Perform the given operation on each each field on both vectors, returning a new vector constructed from the operations.
pub fn is_finite(&self) -> bool where
S: BaseFloat,
[src]
pub fn is_finite(&self) -> bool where
S: BaseFloat,
Test whether or not the vector is infinite.
pub fn cast<T>(&self) -> Option<Vector2<T>> where
S: NumCast + Clone,
T: NumCast,
[src]
pub fn cast<T>(&self) -> Option<Vector2<T>> where
S: NumCast + Clone,
T: NumCast,
Component-wise casting to another type.
pub fn zero() -> Vector2<S> where
S: Zero,
[src]
pub fn zero() -> Vector2<S> where
S: Zero,
A zeroed vector.
pub fn is_zero(&self) -> bool where
S: PartialEq + Zero,
[src]
pub fn is_zero(&self) -> bool where
S: PartialEq + Zero,
Whether or not the vector is zeroed.
pub fn one() -> Vector2<S> where
S: One,
[src]
pub fn one() -> Vector2<S> where
S: One,
A vector with 1
for each element.
pub fn is_one(&self) -> bool where
S: PartialEq + One,
[src]
pub fn is_one(&self) -> bool where
S: PartialEq + One,
Whether or not each element in the vector is equal to 1
.
pub fn is_nan(&self) -> bool where
S: BaseFloat,
[src]
pub fn is_nan(&self) -> bool where
S: BaseFloat,
Tests whether or not any of the vector's elements is NaN
.
pub fn sum(self) -> S where
S: Add<Output = S> + Copy,
[src]
pub fn sum(self) -> S where
S: Add<Output = S> + Copy,
Sum the fields of the vector.
pub fn product(self) -> S where
S: Mul<Output = S> + Copy,
[src]
pub fn product(self) -> S where
S: Mul<Output = S> + Copy,
The product of the fields of the vector.
pub fn limit_magnitude(self, limit: S) -> Self where
S: BaseFloat,
[src]
pub fn limit_magnitude(self, limit: S) -> Self where
S: BaseFloat,
Return a vector whose magnitude is limited to the given value.
pub fn with_magnitude(self, magnitude: S) -> Self where
S: BaseFloat,
[src]
pub fn with_magnitude(self, magnitude: S) -> Self where
S: BaseFloat,
Return a vector with the given magnitude.
pub fn normalize(self) -> Self where
S: BaseFloat,
[src]
pub fn normalize(self) -> Self where
S: BaseFloat,
Return a normalized vector.
If self
is_zero
, this returns self
.
pub fn dot(self, other: Vector2<S>) -> S where
S: BaseFloat,
[src]
pub fn dot(self, other: Vector2<S>) -> S where
S: BaseFloat,
The dot product of self and the given vector.
impl<S> Vector2<S>
[src]
impl<S> Vector2<S>
pub fn unit_x() -> Vector2<S> where
S: Zero + One,
[src]
pub fn unit_x() -> Vector2<S> where
S: Zero + One,
A unit vector in the x
direction.
pub fn unit_y() -> Vector2<S> where
S: Zero + One,
[src]
pub fn unit_y() -> Vector2<S> where
S: Zero + One,
A unit vector in the y
direction.
pub fn perp_dot(self, other: Vector2<S>) -> S where
S: Sub<Output = S> + Mul<Output = S>,
[src]
pub fn perp_dot(self, other: Vector2<S>) -> S where
S: Sub<Output = S> + Mul<Output = S>,
The perpendicular dot product of the vector and other
.
pub fn extend(self, z: S) -> Vector3<S>
[src]
pub fn extend(self, z: S) -> Vector3<S>
Create a Vector3
, using the x
and y
values from this vector, and the
provided z
.
pub fn angle(self) -> S where
S: BaseFloat,
[src]
pub fn angle(self) -> S where
S: BaseFloat,
Returns the angle of the vector in radians.
Trait Implementations
impl<S> From<Vector2<S>> for Vector2<S>
[src]
impl<S> From<Vector2<S>> for Vector2<S>
impl<S> Into<Vector2<S>> for Vector2<S>
[src]
impl<S> Into<Vector2<S>> for Vector2<S>
impl<S> VectorSpace for Vector2<S> where
S: BaseNum,
[src]
impl<S> VectorSpace for Vector2<S> where
S: BaseNum,
type Scalar = S
The associated scalar.
impl<S> MetricSpace for Vector2<S> where
S: BaseFloat,
[src]
impl<S> MetricSpace for Vector2<S> where
S: BaseFloat,
type Metric = S
The metric to be returned by the distance
function.
fn distance2(self, other: Self) -> S
[src]
fn distance2(self, other: Self) -> S
Returns the squared distance. Read more
fn distance(self, other: Self) -> Self::Metric
[src]
fn distance(self, other: Self) -> Self::Metric
The distance between two values.
impl<S> ApproxEq for Vector2<S> where
S: ApproxEq,
S::Epsilon: Copy,
[src]
impl<S> ApproxEq for Vector2<S> where
S: ApproxEq,
S::Epsilon: Copy,
type Epsilon = S::Epsilon
Used for specifying relative comparisons.
fn default_epsilon() -> S::Epsilon
[src]
fn default_epsilon() -> S::Epsilon
The default tolerance to use when testing values that are close together. Read more
fn default_max_relative() -> S::Epsilon
[src]
fn default_max_relative() -> S::Epsilon
The default relative tolerance for testing values that are far-apart. Read more
fn default_max_ulps() -> u32
[src]
fn default_max_ulps() -> u32
The default ULPs to tolerate when testing values that are far-apart. Read more
fn relative_eq(
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
[src]
fn relative_eq(
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
A test for equality that uses a relative comparison if the values are far apart.
fn ulps_eq(&self, other: &Self, epsilon: Self::Epsilon, max_ulps: u32) -> bool
[src]
fn ulps_eq(&self, other: &Self, epsilon: Self::Epsilon, max_ulps: u32) -> bool
A test for equality that uses units in the last place (ULP) if the values are far apart.
fn relative_ne(
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
[src]
fn relative_ne(
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
The inverse of ApproxEq::relative_eq
.
fn ulps_ne(&self, other: &Self, epsilon: Self::Epsilon, max_ulps: u32) -> bool
[src]
fn ulps_ne(&self, other: &Self, epsilon: Self::Epsilon, max_ulps: u32) -> bool
The inverse of ApproxEq::ulps_eq
.
impl<S> ElementWise<S> for Vector2<S> where
S: BaseNum,
[src]
impl<S> ElementWise<S> for Vector2<S> where
S: BaseNum,
fn add_element_wise(self, rhs: S) -> Vector2<S>
[src]
fn add_element_wise(self, rhs: S) -> Vector2<S>
fn sub_element_wise(self, rhs: S) -> Vector2<S>
[src]
fn sub_element_wise(self, rhs: S) -> Vector2<S>
fn mul_element_wise(self, rhs: S) -> Vector2<S>
[src]
fn mul_element_wise(self, rhs: S) -> Vector2<S>
fn div_element_wise(self, rhs: S) -> Vector2<S>
[src]
fn div_element_wise(self, rhs: S) -> Vector2<S>
fn rem_element_wise(self, rhs: S) -> Vector2<S>
[src]
fn rem_element_wise(self, rhs: S) -> Vector2<S>
fn add_assign_element_wise(&mut self, rhs: S)
[src]
fn add_assign_element_wise(&mut self, rhs: S)
fn sub_assign_element_wise(&mut self, rhs: S)
[src]
fn sub_assign_element_wise(&mut self, rhs: S)
fn mul_assign_element_wise(&mut self, rhs: S)
[src]
fn mul_assign_element_wise(&mut self, rhs: S)
fn div_assign_element_wise(&mut self, rhs: S)
[src]
fn div_assign_element_wise(&mut self, rhs: S)
fn rem_assign_element_wise(&mut self, rhs: S)
[src]
fn rem_assign_element_wise(&mut self, rhs: S)
impl<S> ElementWise for Vector2<S> where
S: BaseFloat,
[src]
impl<S> ElementWise for Vector2<S> where
S: BaseFloat,
fn add_element_wise(self, rhs: Vector2<S>) -> Vector2<S>
[src]
fn add_element_wise(self, rhs: Vector2<S>) -> Vector2<S>
fn sub_element_wise(self, rhs: Vector2<S>) -> Vector2<S>
[src]
fn sub_element_wise(self, rhs: Vector2<S>) -> Vector2<S>
fn mul_element_wise(self, rhs: Vector2<S>) -> Vector2<S>
[src]
fn mul_element_wise(self, rhs: Vector2<S>) -> Vector2<S>
fn div_element_wise(self, rhs: Vector2<S>) -> Vector2<S>
[src]
fn div_element_wise(self, rhs: Vector2<S>) -> Vector2<S>
fn rem_element_wise(self, rhs: Vector2<S>) -> Vector2<S>
[src]
fn rem_element_wise(self, rhs: Vector2<S>) -> Vector2<S>
fn add_assign_element_wise(&mut self, rhs: Vector2<S>)
[src]
fn add_assign_element_wise(&mut self, rhs: Vector2<S>)
fn sub_assign_element_wise(&mut self, rhs: Vector2<S>)
[src]
fn sub_assign_element_wise(&mut self, rhs: Vector2<S>)
fn mul_assign_element_wise(&mut self, rhs: Vector2<S>)
[src]
fn mul_assign_element_wise(&mut self, rhs: Vector2<S>)
fn div_assign_element_wise(&mut self, rhs: Vector2<S>)
[src]
fn div_assign_element_wise(&mut self, rhs: Vector2<S>)
fn rem_assign_element_wise(&mut self, rhs: Vector2<S>)
[src]
fn rem_assign_element_wise(&mut self, rhs: Vector2<S>)
impl<S> Array for Vector2<S> where
S: Copy,
[src]
impl<S> Array for Vector2<S> where
S: Copy,
type Element = S
fn len() -> usize
[src]
fn len() -> usize
Get the number of elements in the array type Read more
fn from_value(scalar: S) -> Vector2<S>
[src]
fn from_value(scalar: S) -> Vector2<S>
Construct a vector from a single value, replicating it. Read more
fn sum(self) -> S where
S: Add<Output = S>,
[src]
fn sum(self) -> S where
S: Add<Output = S>,
The sum of the elements of the array.
fn product(self) -> S where
S: Mul<Output = S>,
[src]
fn product(self) -> S where
S: Mul<Output = S>,
The product of the elements of the array.
fn as_ptr(&self) -> *const Self::Element
[src]
fn as_ptr(&self) -> *const Self::Element
Get the pointer to the first element of the array.
fn as_mut_ptr(&mut self) -> *mut Self::Element
[src]
fn as_mut_ptr(&mut self) -> *mut Self::Element
Get a mutable pointer to the first element of the array.
fn swap_elements(&mut self, i: usize, j: usize)
[src]
fn swap_elements(&mut self, i: usize, j: usize)
Swap the elements at indices i
and j
in-place.
impl<S> EuclideanSpace for Vector2<S> where
S: BaseNum,
[src]
impl<S> EuclideanSpace for Vector2<S> where
S: BaseNum,
type Scalar = S
The associated scalar over which the space is defined. Read more
type Diff = Vector2<S>
The associated space of displacement vectors.
fn origin() -> Self
[src]
fn origin() -> Self
The point at the origin of the Euclidean space.
fn from_vec(v: Vector2<S>) -> Self
[src]
fn from_vec(v: Vector2<S>) -> Self
Convert a displacement vector to a point. Read more
fn to_vec(self) -> Vector2<S>
[src]
fn to_vec(self) -> Vector2<S>
Convert a point to a displacement vector. Read more
fn dot(self, other: Vector2<S>) -> S
[src]
fn dot(self, other: Vector2<S>) -> S
This is a weird one, but its useful for plane calculations.
fn midpoint(self, other: Self) -> Self
[src]
fn midpoint(self, other: Self) -> Self
Returns the middle point between two other points. Read more
fn centroid(points: &[Self]) -> Self
[src]
fn centroid(points: &[Self]) -> Self
Returns the average position of all points in the slice. Read more
impl<S> From<Point2<S>> for Vector2<S>
[src]
impl<S> From<Point2<S>> for Vector2<S>
impl<S> Into<Point2<S>> for Vector2<S>
[src]
impl<S> Into<Point2<S>> for Vector2<S>
impl<S> InnerSpace for Vector2<S> where
S: BaseFloat,
[src]
impl<S> InnerSpace for Vector2<S> where
S: BaseFloat,
fn dot(self, other: Vector2<S>) -> S
[src]
fn dot(self, other: Vector2<S>) -> S
Vector dot (or inner) product.
fn angle(self, other: Vector2<S>) -> Rad<S>
[src]
fn angle(self, other: Vector2<S>) -> Rad<S>
Returns the angle between two vectors in radians.
fn is_perpendicular(self, other: Self) -> bool
[src]
fn is_perpendicular(self, other: Self) -> bool
Returns true
if the vector is perpendicular (at right angles) to the other vector. Read more
fn magnitude2(self) -> Self::Scalar
[src]
fn magnitude2(self) -> Self::Scalar
Returns the squared magnitude. Read more
fn magnitude(self) -> Self::Scalar
[src]
fn magnitude(self) -> Self::Scalar
The distance from the tail to the tip of the vector.
fn normalize(self) -> Self
[src]
fn normalize(self) -> Self
Returns a vector with the same direction, but with a magnitude of 1
.
fn normalize_to(self, magnitude: Self::Scalar) -> Self
[src]
fn normalize_to(self, magnitude: Self::Scalar) -> Self
Returns a vector with the same direction and a given magnitude.
fn lerp(self, other: Self, amount: Self::Scalar) -> Self
[src]
fn lerp(self, other: Self, amount: Self::Scalar) -> Self
Returns the result of linearly interpolating the magnitude of the vector towards the magnitude of other
by the specified amount. Read more
fn project_on(self, other: Self) -> Self
[src]
fn project_on(self, other: Self) -> Self
Returns the vector projection of the current inner space projected onto the supplied argument. Read more
impl<S: Default> Default for Vector2<S>
[src]
impl<S: Default> Default for Vector2<S>
impl<S: Debug> Debug for Vector2<S>
[src]
impl<S: Debug> Debug for Vector2<S>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<S: PartialEq> PartialEq for Vector2<S>
[src]
impl<S: PartialEq> PartialEq for Vector2<S>
fn eq(&self, other: &Vector2<S>) -> bool
[src]
fn eq(&self, other: &Vector2<S>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Vector2<S>) -> bool
[src]
fn ne(&self, other: &Vector2<S>) -> bool
This method tests for !=
.
impl<S: Eq> Eq for Vector2<S>
[src]
impl<S: Eq> Eq for Vector2<S>
impl<S: Copy> Copy for Vector2<S>
[src]
impl<S: Copy> Copy for Vector2<S>
impl<S: Clone> Clone for Vector2<S>
[src]
impl<S: Clone> Clone for Vector2<S>
fn clone(&self) -> Vector2<S>
[src]
fn clone(&self) -> Vector2<S>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<S: Hash> Hash for Vector2<S>
[src]
impl<S: Hash> Hash for Vector2<S>
fn hash<__HS: Hasher>(&self, state: &mut __HS)
[src]
fn hash<__HS: Hasher>(&self, state: &mut __HS)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<S> Sum<Vector2<S>> for Vector2<S> where
S: Zero + Add<Output = S>,
[src]
impl<S> Sum<Vector2<S>> for Vector2<S> where
S: Zero + Add<Output = S>,
fn sum<I>(iter: I) -> Vector2<S> where
I: Iterator<Item = Vector2<S>>,
[src]
fn sum<I>(iter: I) -> Vector2<S> where
I: Iterator<Item = Vector2<S>>,
Method which takes an iterator and generates Self
from the elements by "summing up" the items. Read more
impl<'a, S: 'a> Sum<&'a Vector2<S>> for Vector2<S> where
S: 'a + Clone + Zero + Add<Output = S>,
[src]
impl<'a, S: 'a> Sum<&'a Vector2<S>> for Vector2<S> where
S: 'a + Clone + Zero + Add<Output = S>,
fn sum<I>(iter: I) -> Vector2<S> where
I: Iterator<Item = &'a Vector2<S>>,
[src]
fn sum<I>(iter: I) -> Vector2<S> where
I: Iterator<Item = &'a Vector2<S>>,
Method which takes an iterator and generates Self
from the elements by "summing up" the items. Read more
impl<S> Neg for Vector2<S> where
S: Neg<Output = S>,
[src]
impl<S> Neg for Vector2<S> where
S: Neg<Output = S>,
type Output = Vector2<S>
The resulting type after applying the -
operator.
fn neg(self) -> Vector2<S>
[src]
fn neg(self) -> Vector2<S>
Performs the unary -
operation.
impl<S> Add for Vector2<S> where
S: Add<Output = S>,
[src]
impl<S> Add for Vector2<S> where
S: Add<Output = S>,
type Output = Vector2<S>
The resulting type after applying the +
operator.
fn add(self, other: Self) -> Self
[src]
fn add(self, other: Self) -> Self
Performs the +
operation.
impl<S> Sub for Vector2<S> where
S: Sub<Output = S>,
[src]
impl<S> Sub for Vector2<S> where
S: Sub<Output = S>,
type Output = Vector2<S>
The resulting type after applying the -
operator.
fn sub(self, other: Self) -> Self
[src]
fn sub(self, other: Self) -> Self
Performs the -
operation.
impl<S> Mul for Vector2<S> where
S: Mul<Output = S>,
[src]
impl<S> Mul for Vector2<S> where
S: Mul<Output = S>,
type Output = Vector2<S>
The resulting type after applying the *
operator.
fn mul(self, other: Self) -> Self
[src]
fn mul(self, other: Self) -> Self
Performs the *
operation.
impl<S> Div for Vector2<S> where
S: Div<Output = S>,
[src]
impl<S> Div for Vector2<S> where
S: Div<Output = S>,
type Output = Vector2<S>
The resulting type after applying the /
operator.
fn div(self, other: Self) -> Self
[src]
fn div(self, other: Self) -> Self
Performs the /
operation.
impl<S> Rem for Vector2<S> where
S: Rem<Output = S>,
[src]
impl<S> Rem for Vector2<S> where
S: Rem<Output = S>,
type Output = Vector2<S>
The resulting type after applying the %
operator.
fn rem(self, other: Self) -> Self
[src]
fn rem(self, other: Self) -> Self
Performs the %
operation.
impl<S> AddAssign for Vector2<S> where
S: AddAssign,
[src]
impl<S> AddAssign for Vector2<S> where
S: AddAssign,
fn add_assign(&mut self, other: Self)
[src]
fn add_assign(&mut self, other: Self)
Performs the +=
operation.
impl<S> SubAssign for Vector2<S> where
S: SubAssign,
[src]
impl<S> SubAssign for Vector2<S> where
S: SubAssign,
fn sub_assign(&mut self, other: Self)
[src]
fn sub_assign(&mut self, other: Self)
Performs the -=
operation.
impl<S> DivAssign for Vector2<S> where
S: Copy + DivAssign,
[src]
impl<S> DivAssign for Vector2<S> where
S: Copy + DivAssign,
fn div_assign(&mut self, other: Self)
[src]
fn div_assign(&mut self, other: Self)
Performs the /=
operation.
impl<S> MulAssign for Vector2<S> where
S: Copy + MulAssign,
[src]
impl<S> MulAssign for Vector2<S> where
S: Copy + MulAssign,
fn mul_assign(&mut self, other: Self)
[src]
fn mul_assign(&mut self, other: Self)
Performs the *=
operation.
impl<S> RemAssign for Vector2<S> where
S: Copy + RemAssign,
[src]
impl<S> RemAssign for Vector2<S> where
S: Copy + RemAssign,
fn rem_assign(&mut self, other: Self)
[src]
fn rem_assign(&mut self, other: Self)
Performs the %=
operation.
impl<S> Rem<S> for Vector2<S> where
S: Copy + Rem<Output = S>,
[src]
impl<S> Rem<S> for Vector2<S> where
S: Copy + Rem<Output = S>,
type Output = Vector2<S>
The resulting type after applying the %
operator.
fn rem(self, scalar: S) -> Self
[src]
fn rem(self, scalar: S) -> Self
Performs the %
operation.
impl<S> Div<S> for Vector2<S> where
S: Copy + Div<Output = S>,
[src]
impl<S> Div<S> for Vector2<S> where
S: Copy + Div<Output = S>,
type Output = Vector2<S>
The resulting type after applying the /
operator.
fn div(self, scalar: S) -> Self
[src]
fn div(self, scalar: S) -> Self
Performs the /
operation.
impl<S> Mul<S> for Vector2<S> where
S: Copy + Mul<Output = S>,
[src]
impl<S> Mul<S> for Vector2<S> where
S: Copy + Mul<Output = S>,
type Output = Vector2<S>
The resulting type after applying the *
operator.
fn mul(self, scalar: S) -> Self
[src]
fn mul(self, scalar: S) -> Self
Performs the *
operation.
impl<S> RemAssign<S> for Vector2<S> where
S: Copy + RemAssign,
[src]
impl<S> RemAssign<S> for Vector2<S> where
S: Copy + RemAssign,
fn rem_assign(&mut self, scalar: S)
[src]
fn rem_assign(&mut self, scalar: S)
Performs the %=
operation.
impl<S> DivAssign<S> for Vector2<S> where
S: Copy + DivAssign,
[src]
impl<S> DivAssign<S> for Vector2<S> where
S: Copy + DivAssign,
fn div_assign(&mut self, scalar: S)
[src]
fn div_assign(&mut self, scalar: S)
Performs the /=
operation.
impl<S> MulAssign<S> for Vector2<S> where
S: Copy + MulAssign,
[src]
impl<S> MulAssign<S> for Vector2<S> where
S: Copy + MulAssign,
fn mul_assign(&mut self, scalar: S)
[src]
fn mul_assign(&mut self, scalar: S)
Performs the *=
operation.
impl<S> Index<usize> for Vector2<S>
[src]
impl<S> Index<usize> for Vector2<S>
type Output = S
The returned type after indexing.
ⓘImportant traits for &'a mut Rfn index<'a>(&'a self, i: usize) -> &'a S
[src]
fn index<'a>(&'a self, i: usize) -> &'a S
Performs the indexing (container[index]
) operation.
impl<S> IndexMut<usize> for Vector2<S>
[src]
impl<S> IndexMut<usize> for Vector2<S>
ⓘImportant traits for &'a mut Rfn index_mut<'a>(&'a mut self, i: usize) -> &'a mut S
[src]
fn index_mut<'a>(&'a mut self, i: usize) -> &'a mut S
Performs the mutable indexing (container[index]
) operation.
impl<S> Index<Range<usize>> for Vector2<S>
[src]
impl<S> Index<Range<usize>> for Vector2<S>
type Output = [S]
The returned type after indexing.
fn index<'a>(&'a self, i: Range<usize>) -> &'a [S]
[src]
fn index<'a>(&'a self, i: Range<usize>) -> &'a [S]
Performs the indexing (container[index]
) operation.
impl<S> IndexMut<Range<usize>> for Vector2<S>
[src]
impl<S> IndexMut<Range<usize>> for Vector2<S>
fn index_mut<'a>(&'a mut self, i: Range<usize>) -> &'a mut [S]
[src]
fn index_mut<'a>(&'a mut self, i: Range<usize>) -> &'a mut [S]
Performs the mutable indexing (container[index]
) operation.
impl<S> Index<RangeTo<usize>> for Vector2<S>
[src]
impl<S> Index<RangeTo<usize>> for Vector2<S>
type Output = [S]
The returned type after indexing.
fn index<'a>(&'a self, i: RangeTo<usize>) -> &'a [S]
[src]
fn index<'a>(&'a self, i: RangeTo<usize>) -> &'a [S]
Performs the indexing (container[index]
) operation.
impl<S> IndexMut<RangeTo<usize>> for Vector2<S>
[src]
impl<S> IndexMut<RangeTo<usize>> for Vector2<S>
fn index_mut<'a>(&'a mut self, i: RangeTo<usize>) -> &'a mut [S]
[src]
fn index_mut<'a>(&'a mut self, i: RangeTo<usize>) -> &'a mut [S]
Performs the mutable indexing (container[index]
) operation.
impl<S> Index<RangeFrom<usize>> for Vector2<S>
[src]
impl<S> Index<RangeFrom<usize>> for Vector2<S>
type Output = [S]
The returned type after indexing.
fn index<'a>(&'a self, i: RangeFrom<usize>) -> &'a [S]
[src]
fn index<'a>(&'a self, i: RangeFrom<usize>) -> &'a [S]
Performs the indexing (container[index]
) operation.
impl<S> IndexMut<RangeFrom<usize>> for Vector2<S>
[src]
impl<S> IndexMut<RangeFrom<usize>> for Vector2<S>
fn index_mut<'a>(&'a mut self, i: RangeFrom<usize>) -> &'a mut [S]
[src]
fn index_mut<'a>(&'a mut self, i: RangeFrom<usize>) -> &'a mut [S]
Performs the mutable indexing (container[index]
) operation.
impl<S> Index<RangeFull> for Vector2<S>
[src]
impl<S> Index<RangeFull> for Vector2<S>
type Output = [S]
The returned type after indexing.
fn index<'a>(&'a self, i: RangeFull) -> &'a [S]
[src]
fn index<'a>(&'a self, i: RangeFull) -> &'a [S]
Performs the indexing (container[index]
) operation.
impl<S> IndexMut<RangeFull> for Vector2<S>
[src]
impl<S> IndexMut<RangeFull> for Vector2<S>
fn index_mut<'a>(&'a mut self, i: RangeFull) -> &'a mut [S]
[src]
fn index_mut<'a>(&'a mut self, i: RangeFull) -> &'a mut [S]
Performs the mutable indexing (container[index]
) operation.
impl<S> From<[S; 2]> for Vector2<S> where
S: Copy,
[src]
impl<S> From<[S; 2]> for Vector2<S> where
S: Copy,
impl<S> Into<[S; 2]> for Vector2<S>
[src]
impl<S> Into<[S; 2]> for Vector2<S>
impl<S> AsRef<[S; 2]> for Vector2<S>
[src]
impl<S> AsRef<[S; 2]> for Vector2<S>
impl<S> AsMut<[S; 2]> for Vector2<S>
[src]
impl<S> AsMut<[S; 2]> for Vector2<S>
impl<S> Deref for Vector2<S>
[src]
impl<S> Deref for Vector2<S>
type Target = [S; 2]
The resulting type after dereferencing.
fn deref(&self) -> &Self::Target
[src]
fn deref(&self) -> &Self::Target
Dereferences the value.
impl<S> DerefMut for Vector2<S>
[src]
impl<S> DerefMut for Vector2<S>
impl<S> Bounded for Vector2<S> where
S: Bounded,
[src]
impl<S> Bounded for Vector2<S> where
S: Bounded,
fn min_value() -> Vector2<S>
[src]
fn min_value() -> Vector2<S>
returns the smallest finite number this type can represent
fn max_value() -> Vector2<S>
[src]
fn max_value() -> Vector2<S>
returns the largest finite number this type can represent
impl<S> Zero for Vector2<S> where
S: PartialEq + Zero,
[src]
impl<S> Zero for Vector2<S> where
S: PartialEq + Zero,
fn zero() -> Vector2<S>
[src]
fn zero() -> Vector2<S>
Returns the additive identity element of Self
, 0
. Read more
fn is_zero(&self) -> bool
[src]
fn is_zero(&self) -> bool
Returns true
if self
is equal to the additive identity.
impl<S> Distribution<Vector2<S>> for Standard where
Standard: Distribution<S>,
[src]
impl<S> Distribution<Vector2<S>> for Standard where
Standard: Distribution<S>,
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Vector2<S>
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Vector2<S>
Generate a random value of T
, using rng
as the source of randomness.
ⓘImportant traits for DistIter<'a, D, R, T>fn sample_iter<R>(&'a self, rng: &'a mut R) -> DistIter<'a, Self, R, T> where
R: Rng,
[src]
fn sample_iter<R>(&'a self, rng: &'a mut R) -> DistIter<'a, Self, R, T> where
R: Rng,
Create an iterator that generates random values of T
, using rng
as the source of randomness. Read more
impl<S> From<(S, S)> for Vector2<S>
[src]
impl<S> From<(S, S)> for Vector2<S>
impl<S> Into<(S, S)> for Vector2<S>
[src]
impl<S> Into<(S, S)> for Vector2<S>
impl<S> From<Vector2<S>> for Vector3<S> where
S: Zero,
[src]
impl<S> From<Vector2<S>> for Vector3<S> where
S: Zero,
impl<S> From<Vector2<S>> for Vector4<S> where
S: Zero,
[src]
impl<S> From<Vector2<S>> for Vector4<S> where
S: Zero,