Struct nannou::prelude::Point2
[−]
[src]
#[repr(C)]pub struct Point2<S> { pub x: S, pub y: S, }
A point in 2-dimensional space.
This type is marked as #[repr(C)]
.
Fields
x: S
y: S
Methods
impl<S> Point2<S>
[src]
pub fn new(x: S, y: S) -> Point2<S>
[src]
Construct a new point, using the provided values.
pub fn map<U, F>(self, f: F) -> Point2<U> where
F: FnMut(S) -> U,
[src]
F: FnMut(S) -> U,
Perform the given operation on each field in the point, returning a new point constructed from the operations.
impl<S> Point2<S> where
S: Copy + NumCast,
[src]
S: Copy + NumCast,
pub fn cast<T>(&self) -> Option<Point2<T>> where
T: NumCast,
[src]
T: NumCast,
Component-wise casting to another type
Trait Implementations
impl<S> ElementWise<S> for Point2<S> where
S: BaseNum,
[src]
S: BaseNum,
fn add_element_wise(self, rhs: S) -> Point2<S>
[src]
fn sub_element_wise(self, rhs: S) -> Point2<S>
[src]
fn mul_element_wise(self, rhs: S) -> Point2<S>
[src]
fn div_element_wise(self, rhs: S) -> Point2<S>
[src]
fn rem_element_wise(self, rhs: S) -> Point2<S>
[src]
fn add_assign_element_wise(&mut self, rhs: S)
[src]
fn sub_assign_element_wise(&mut self, rhs: S)
[src]
fn mul_assign_element_wise(&mut self, rhs: S)
[src]
fn div_assign_element_wise(&mut self, rhs: S)
[src]
fn rem_assign_element_wise(&mut self, rhs: S)
[src]
impl<S> ElementWise<Point2<S>> for Point2<S> where
S: BaseNum,
[src]
S: BaseNum,
fn add_element_wise(self, rhs: Point2<S>) -> Point2<S>
[src]
fn sub_element_wise(self, rhs: Point2<S>) -> Point2<S>
[src]
fn mul_element_wise(self, rhs: Point2<S>) -> Point2<S>
[src]
fn div_element_wise(self, rhs: Point2<S>) -> Point2<S>
[src]
fn rem_element_wise(self, rhs: Point2<S>) -> Point2<S>
[src]
fn add_assign_element_wise(&mut self, rhs: Point2<S>)
[src]
fn sub_assign_element_wise(&mut self, rhs: Point2<S>)
[src]
fn mul_assign_element_wise(&mut self, rhs: Point2<S>)
[src]
fn div_assign_element_wise(&mut self, rhs: Point2<S>)
[src]
fn rem_assign_element_wise(&mut self, rhs: Point2<S>)
[src]
impl<'a, S> Sub<&'a Vector2<S>> for Point2<S> where
S: BaseNum,
[src]
S: BaseNum,
type Output = Point2<S>
The resulting type after applying the -
operator.
fn sub(self, other: &'a Vector2<S>) -> Point2<S>
[src]
Performs the -
operation.
impl<S> Sub<Vector2<S>> for Point2<S> where
S: BaseNum,
[src]
S: BaseNum,
type Output = Point2<S>
The resulting type after applying the -
operator.
fn sub(self, other: Vector2<S>) -> Point2<S>
[src]
Performs the -
operation.
impl<'a, S> Sub<Point2<S>> for &'a Point2<S> where
S: BaseNum,
[src]
S: BaseNum,
type Output = Vector2<S>
The resulting type after applying the -
operator.
fn sub(self, other: Point2<S>) -> Vector2<S>
[src]
Performs the -
operation.
impl<S> Sub<Point2<S>> for Point2<S> where
S: BaseNum,
[src]
S: BaseNum,
type Output = Vector2<S>
The resulting type after applying the -
operator.
fn sub(self, other: Point2<S>) -> Vector2<S>
[src]
Performs the -
operation.
impl<'a, 'b, S> Sub<&'a Vector2<S>> for &'b Point2<S> where
S: BaseNum,
[src]
S: BaseNum,
type Output = Point2<S>
The resulting type after applying the -
operator.
fn sub(self, other: &'a Vector2<S>) -> Point2<S>
[src]
Performs the -
operation.
impl<'a, S> Sub<&'a Point2<S>> for Point2<S> where
S: BaseNum,
[src]
S: BaseNum,
type Output = Vector2<S>
The resulting type after applying the -
operator.
fn sub(self, other: &'a Point2<S>) -> Vector2<S>
[src]
Performs the -
operation.
impl<'a, S> Sub<Vector2<S>> for &'a Point2<S> where
S: BaseNum,
[src]
S: BaseNum,
type Output = Point2<S>
The resulting type after applying the -
operator.
fn sub(self, other: Vector2<S>) -> Point2<S>
[src]
Performs the -
operation.
impl<'a, 'b, S> Sub<&'a Point2<S>> for &'b Point2<S> where
S: BaseNum,
[src]
S: BaseNum,
type Output = Vector2<S>
The resulting type after applying the -
operator.
fn sub(self, other: &'a Point2<S>) -> Vector2<S>
[src]
Performs the -
operation.
impl<S> IndexMut<RangeFrom<usize>> for Point2<S>
[src]
fn index_mut(&'a mut self, i: RangeFrom<usize>) -> &'a mut [S]
[src]
Performs the mutable indexing (container[index]
) operation.
impl<S> IndexMut<usize> for Point2<S>
[src]
ⓘImportant traits for &'a mut Wfn index_mut(&'a mut self, i: usize) -> &'a mut S
[src]
Performs the mutable indexing (container[index]
) operation.
impl<S> IndexMut<RangeFull> for Point2<S>
[src]
fn index_mut(&'a mut self, i: RangeFull) -> &'a mut [S]
[src]
Performs the mutable indexing (container[index]
) operation.
impl<S> IndexMut<RangeTo<usize>> for Point2<S>
[src]
fn index_mut(&'a mut self, i: RangeTo<usize>) -> &'a mut [S]
[src]
Performs the mutable indexing (container[index]
) operation.
impl<S> IndexMut<Range<usize>> for Point2<S>
[src]
fn index_mut(&'a mut self, i: Range<usize>) -> &'a mut [S]
[src]
Performs the mutable indexing (container[index]
) operation.
impl<S> ApproxEq for Point2<S> where
S: BaseFloat,
[src]
S: BaseFloat,
type Epsilon = <S as ApproxEq>::Epsilon
Used for specifying relative comparisons.
fn default_epsilon() -> <S as ApproxEq>::Epsilon
[src]
The default tolerance to use when testing values that are close together. Read more
fn default_max_relative() -> <S as ApproxEq>::Epsilon
[src]
The default relative tolerance for testing values that are far-apart. Read more
fn default_max_ulps() -> u32
[src]
The default ULPs to tolerate when testing values that are far-apart. Read more
fn relative_eq(
&self,
other: &Point2<S>,
epsilon: <S as ApproxEq>::Epsilon,
max_relative: <S as ApproxEq>::Epsilon
) -> bool
[src]
&self,
other: &Point2<S>,
epsilon: <S as ApproxEq>::Epsilon,
max_relative: <S as ApproxEq>::Epsilon
) -> bool
A test for equality that uses a relative comparison if the values are far apart.
fn ulps_eq(
&self,
other: &Point2<S>,
epsilon: <S as ApproxEq>::Epsilon,
max_ulps: u32
) -> bool
[src]
&self,
other: &Point2<S>,
epsilon: <S as ApproxEq>::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
&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
The inverse of ApproxEq::ulps_eq
.
impl<'a> Mul<&'a Point2<i16>> for i16
[src]
type Output = Point2<i16>
The resulting type after applying the *
operator.
fn mul(self, other: &'a Point2<i16>) -> Point2<i16>
[src]
Performs the *
operation.
impl<'a> Mul<&'a Point2<i64>> for i64
[src]
type Output = Point2<i64>
The resulting type after applying the *
operator.
fn mul(self, other: &'a Point2<i64>) -> Point2<i64>
[src]
Performs the *
operation.
impl<'a> Mul<&'a Point2<i32>> for i32
[src]
type Output = Point2<i32>
The resulting type after applying the *
operator.
fn mul(self, other: &'a Point2<i32>) -> Point2<i32>
[src]
Performs the *
operation.
impl<'a, S> Mul<S> for &'a Point2<S> where
S: BaseNum,
[src]
S: BaseNum,
type Output = Point2<S>
The resulting type after applying the *
operator.
fn mul(self, other: S) -> Point2<S>
[src]
Performs the *
operation.
impl Mul<Point2<u32>> for u32
[src]
type Output = Point2<u32>
The resulting type after applying the *
operator.
fn mul(self, other: Point2<u32>) -> Point2<u32>
[src]
Performs the *
operation.
impl<S> Mul<S> for Point2<S> where
S: BaseNum,
[src]
S: BaseNum,
type Output = Point2<S>
The resulting type after applying the *
operator.
fn mul(self, other: S) -> Point2<S>
[src]
Performs the *
operation.
impl Mul<Point2<u64>> for u64
[src]
type Output = Point2<u64>
The resulting type after applying the *
operator.
fn mul(self, other: Point2<u64>) -> Point2<u64>
[src]
Performs the *
operation.
impl<'a> Mul<&'a Point2<i8>> for i8
[src]
type Output = Point2<i8>
The resulting type after applying the *
operator.
fn mul(self, other: &'a Point2<i8>) -> Point2<i8>
[src]
Performs the *
operation.
impl Mul<Point2<i32>> for i32
[src]
type Output = Point2<i32>
The resulting type after applying the *
operator.
fn mul(self, other: Point2<i32>) -> Point2<i32>
[src]
Performs the *
operation.
impl<'a> Mul<&'a Point2<u16>> for u16
[src]
type Output = Point2<u16>
The resulting type after applying the *
operator.
fn mul(self, other: &'a Point2<u16>) -> Point2<u16>
[src]
Performs the *
operation.
impl Mul<Point2<isize>> for isize
[src]
type Output = Point2<isize>
The resulting type after applying the *
operator.
fn mul(self, other: Point2<isize>) -> Point2<isize>
[src]
Performs the *
operation.
impl Mul<Point2<u8>> for u8
[src]
type Output = Point2<u8>
The resulting type after applying the *
operator.
fn mul(self, other: Point2<u8>) -> Point2<u8>
[src]
Performs the *
operation.
impl Mul<Point2<f32>> for f32
[src]
type Output = Point2<f32>
The resulting type after applying the *
operator.
fn mul(self, other: Point2<f32>) -> Point2<f32>
[src]
Performs the *
operation.
impl<'a> Mul<&'a Point2<f32>> for f32
[src]
type Output = Point2<f32>
The resulting type after applying the *
operator.
fn mul(self, other: &'a Point2<f32>) -> Point2<f32>
[src]
Performs the *
operation.
impl<'a> Mul<&'a Point2<u8>> for u8
[src]
type Output = Point2<u8>
The resulting type after applying the *
operator.
fn mul(self, other: &'a Point2<u8>) -> Point2<u8>
[src]
Performs the *
operation.
impl Mul<Point2<u16>> for u16
[src]
type Output = Point2<u16>
The resulting type after applying the *
operator.
fn mul(self, other: Point2<u16>) -> Point2<u16>
[src]
Performs the *
operation.
impl Mul<Point2<i64>> for i64
[src]
type Output = Point2<i64>
The resulting type after applying the *
operator.
fn mul(self, other: Point2<i64>) -> Point2<i64>
[src]
Performs the *
operation.
impl Mul<Point2<usize>> for usize
[src]
type Output = Point2<usize>
The resulting type after applying the *
operator.
fn mul(self, other: Point2<usize>) -> Point2<usize>
[src]
Performs the *
operation.
impl<'a> Mul<&'a Point2<u64>> for u64
[src]
type Output = Point2<u64>
The resulting type after applying the *
operator.
fn mul(self, other: &'a Point2<u64>) -> Point2<u64>
[src]
Performs the *
operation.
impl<'a> Mul<&'a Point2<usize>> for usize
[src]
type Output = Point2<usize>
The resulting type after applying the *
operator.
fn mul(self, other: &'a Point2<usize>) -> Point2<usize>
[src]
Performs the *
operation.
impl<'a> Mul<&'a Point2<u32>> for u32
[src]
type Output = Point2<u32>
The resulting type after applying the *
operator.
fn mul(self, other: &'a Point2<u32>) -> Point2<u32>
[src]
Performs the *
operation.
impl Mul<Point2<i16>> for i16
[src]
type Output = Point2<i16>
The resulting type after applying the *
operator.
fn mul(self, other: Point2<i16>) -> Point2<i16>
[src]
Performs the *
operation.
impl Mul<Point2<f64>> for f64
[src]
type Output = Point2<f64>
The resulting type after applying the *
operator.
fn mul(self, other: Point2<f64>) -> Point2<f64>
[src]
Performs the *
operation.
impl<'a> Mul<&'a Point2<isize>> for isize
[src]
type Output = Point2<isize>
The resulting type after applying the *
operator.
fn mul(self, other: &'a Point2<isize>) -> Point2<isize>
[src]
Performs the *
operation.
impl<'a> Mul<&'a Point2<f64>> for f64
[src]
type Output = Point2<f64>
The resulting type after applying the *
operator.
fn mul(self, other: &'a Point2<f64>) -> Point2<f64>
[src]
Performs the *
operation.
impl Mul<Point2<i8>> for i8
[src]
type Output = Point2<i8>
The resulting type after applying the *
operator.
fn mul(self, other: Point2<i8>) -> Point2<i8>
[src]
Performs the *
operation.
impl<S> RemAssign<S> for Point2<S> where
S: BaseNum + RemAssign<S>,
[src]
S: BaseNum + RemAssign<S>,
fn rem_assign(&mut self, scalar: S)
[src]
Performs the %=
operation.
impl<S> Into<(S, S)> for Point2<S>
[src]
impl<S> Into<[S; 2]> for Point2<S>
[src]
impl<'a> Rem<&'a Point2<u16>> for u16
[src]
type Output = Point2<u16>
The resulting type after applying the %
operator.
fn rem(self, other: &'a Point2<u16>) -> Point2<u16>
[src]
Performs the %
operation.
impl<'a> Rem<&'a Point2<usize>> for usize
[src]
type Output = Point2<usize>
The resulting type after applying the %
operator.
fn rem(self, other: &'a Point2<usize>) -> Point2<usize>
[src]
Performs the %
operation.
impl Rem<Point2<usize>> for usize
[src]
type Output = Point2<usize>
The resulting type after applying the %
operator.
fn rem(self, other: Point2<usize>) -> Point2<usize>
[src]
Performs the %
operation.
impl Rem<Point2<u8>> for u8
[src]
type Output = Point2<u8>
The resulting type after applying the %
operator.
fn rem(self, other: Point2<u8>) -> Point2<u8>
[src]
Performs the %
operation.
impl<S> Rem<S> for Point2<S> where
S: BaseNum,
[src]
S: BaseNum,
type Output = Point2<S>
The resulting type after applying the %
operator.
fn rem(self, other: S) -> Point2<S>
[src]
Performs the %
operation.
impl Rem<Point2<u32>> for u32
[src]
type Output = Point2<u32>
The resulting type after applying the %
operator.
fn rem(self, other: Point2<u32>) -> Point2<u32>
[src]
Performs the %
operation.
impl<'a> Rem<&'a Point2<i16>> for i16
[src]
type Output = Point2<i16>
The resulting type after applying the %
operator.
fn rem(self, other: &'a Point2<i16>) -> Point2<i16>
[src]
Performs the %
operation.
impl<'a> Rem<&'a Point2<f64>> for f64
[src]
type Output = Point2<f64>
The resulting type after applying the %
operator.
fn rem(self, other: &'a Point2<f64>) -> Point2<f64>
[src]
Performs the %
operation.
impl<'a> Rem<&'a Point2<i32>> for i32
[src]
type Output = Point2<i32>
The resulting type after applying the %
operator.
fn rem(self, other: &'a Point2<i32>) -> Point2<i32>
[src]
Performs the %
operation.
impl Rem<Point2<i16>> for i16
[src]
type Output = Point2<i16>
The resulting type after applying the %
operator.
fn rem(self, other: Point2<i16>) -> Point2<i16>
[src]
Performs the %
operation.
impl<'a> Rem<&'a Point2<f32>> for f32
[src]
type Output = Point2<f32>
The resulting type after applying the %
operator.
fn rem(self, other: &'a Point2<f32>) -> Point2<f32>
[src]
Performs the %
operation.
impl Rem<Point2<u16>> for u16
[src]
type Output = Point2<u16>
The resulting type after applying the %
operator.
fn rem(self, other: Point2<u16>) -> Point2<u16>
[src]
Performs the %
operation.
impl Rem<Point2<f32>> for f32
[src]
type Output = Point2<f32>
The resulting type after applying the %
operator.
fn rem(self, other: Point2<f32>) -> Point2<f32>
[src]
Performs the %
operation.
impl Rem<Point2<i8>> for i8
[src]
type Output = Point2<i8>
The resulting type after applying the %
operator.
fn rem(self, other: Point2<i8>) -> Point2<i8>
[src]
Performs the %
operation.
impl<'a> Rem<&'a Point2<u64>> for u64
[src]
type Output = Point2<u64>
The resulting type after applying the %
operator.
fn rem(self, other: &'a Point2<u64>) -> Point2<u64>
[src]
Performs the %
operation.
impl<'a> Rem<&'a Point2<i8>> for i8
[src]
type Output = Point2<i8>
The resulting type after applying the %
operator.
fn rem(self, other: &'a Point2<i8>) -> Point2<i8>
[src]
Performs the %
operation.
impl Rem<Point2<isize>> for isize
[src]
type Output = Point2<isize>
The resulting type after applying the %
operator.
fn rem(self, other: Point2<isize>) -> Point2<isize>
[src]
Performs the %
operation.
impl Rem<Point2<f64>> for f64
[src]
type Output = Point2<f64>
The resulting type after applying the %
operator.
fn rem(self, other: Point2<f64>) -> Point2<f64>
[src]
Performs the %
operation.
impl<'a> Rem<&'a Point2<u8>> for u8
[src]
type Output = Point2<u8>
The resulting type after applying the %
operator.
fn rem(self, other: &'a Point2<u8>) -> Point2<u8>
[src]
Performs the %
operation.
impl<'a, S> Rem<S> for &'a Point2<S> where
S: BaseNum,
[src]
S: BaseNum,
type Output = Point2<S>
The resulting type after applying the %
operator.
fn rem(self, other: S) -> Point2<S>
[src]
Performs the %
operation.
impl<'a> Rem<&'a Point2<i64>> for i64
[src]
type Output = Point2<i64>
The resulting type after applying the %
operator.
fn rem(self, other: &'a Point2<i64>) -> Point2<i64>
[src]
Performs the %
operation.
impl Rem<Point2<u64>> for u64
[src]
type Output = Point2<u64>
The resulting type after applying the %
operator.
fn rem(self, other: Point2<u64>) -> Point2<u64>
[src]
Performs the %
operation.
impl<'a> Rem<&'a Point2<u32>> for u32
[src]
type Output = Point2<u32>
The resulting type after applying the %
operator.
fn rem(self, other: &'a Point2<u32>) -> Point2<u32>
[src]
Performs the %
operation.
impl<'a> Rem<&'a Point2<isize>> for isize
[src]
type Output = Point2<isize>
The resulting type after applying the %
operator.
fn rem(self, other: &'a Point2<isize>) -> Point2<isize>
[src]
Performs the %
operation.
impl Rem<Point2<i32>> for i32
[src]
type Output = Point2<i32>
The resulting type after applying the %
operator.
fn rem(self, other: Point2<i32>) -> Point2<i32>
[src]
Performs the %
operation.
impl Rem<Point2<i64>> for i64
[src]
type Output = Point2<i64>
The resulting type after applying the %
operator.
fn rem(self, other: Point2<i64>) -> Point2<i64>
[src]
Performs the %
operation.
impl<S> Copy for Point2<S> where
S: Copy,
[src]
S: Copy,
impl<S> AsMut<(S, S)> for Point2<S>
[src]
impl<S> AsMut<[S; 2]> for Point2<S>
[src]
impl<S> AddAssign<Vector2<S>> for Point2<S> where
S: BaseNum + AddAssign<S>,
[src]
S: BaseNum + AddAssign<S>,
fn add_assign(&mut self, vector: Vector2<S>)
[src]
Performs the +=
operation.
impl<S> MulAssign<S> for Point2<S> where
S: BaseNum + MulAssign<S>,
[src]
S: BaseNum + MulAssign<S>,
fn mul_assign(&mut self, scalar: S)
[src]
Performs the *=
operation.
impl<S> PartialEq<Point2<S>> for Point2<S> where
S: PartialEq<S>,
[src]
S: PartialEq<S>,
fn eq(&self, __arg_0: &Point2<S>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Point2<S>) -> bool
[src]
This method tests for !=
.
impl<S> Clone for Point2<S> where
S: Clone,
[src]
S: Clone,
fn clone(&self) -> Point2<S>
[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<'a, S> Add<&'a Vector2<S>> for Point2<S> where
S: BaseNum,
[src]
S: BaseNum,
type Output = Point2<S>
The resulting type after applying the +
operator.
fn add(self, other: &'a Vector2<S>) -> Point2<S>
[src]
Performs the +
operation.
impl<S> Add<Vector2<S>> for Point2<S> where
S: BaseNum,
[src]
S: BaseNum,
type Output = Point2<S>
The resulting type after applying the +
operator.
fn add(self, other: Vector2<S>) -> Point2<S>
[src]
Performs the +
operation.
impl<'a, 'b, S> Add<&'a Vector2<S>> for &'b Point2<S> where
S: BaseNum,
[src]
S: BaseNum,
type Output = Point2<S>
The resulting type after applying the +
operator.
fn add(self, other: &'a Vector2<S>) -> Point2<S>
[src]
Performs the +
operation.
impl<'a, S> Add<Vector2<S>> for &'a Point2<S> where
S: BaseNum,
[src]
S: BaseNum,
type Output = Point2<S>
The resulting type after applying the +
operator.
fn add(self, other: Vector2<S>) -> Point2<S>
[src]
Performs the +
operation.
impl<S> Array for Point2<S> where
S: BaseNum,
[src]
S: BaseNum,
type Element = S
fn len() -> usize
[src]
Get the number of elements in the array type Read more
fn from_value(scalar: S) -> Point2<S>
[src]
Construct a vector from a single value, replicating it. Read more
fn sum(self) -> S where
S: Add<S, Output = S>,
[src]
S: Add<S, Output = S>,
The sum of the elements of the array.
fn product(self) -> S where
S: Mul<S, Output = S>,
[src]
S: Mul<S, Output = S>,
The product of the elements of the array.
fn as_ptr(&self) -> *const Self::Element
[src]
Get the pointer to the first element of the array.
fn as_mut_ptr(&mut self) -> *mut Self::Element
[src]
Get a mutable pointer to the first element of the array.
fn swap_elements(&mut self, i: usize, j: usize)
[src]
Swap the elements at indices i
and j
in-place.
impl<S> Index<RangeFrom<usize>> for Point2<S>
[src]
type Output = [S]
The returned type after indexing.
fn index(&'a self, i: RangeFrom<usize>) -> &'a [S]
[src]
Performs the indexing (container[index]
) operation.
impl<S> Index<RangeFull> for Point2<S>
[src]
type Output = [S]
The returned type after indexing.
fn index(&'a self, i: RangeFull) -> &'a [S]
[src]
Performs the indexing (container[index]
) operation.
impl<S> Index<Range<usize>> for Point2<S>
[src]
type Output = [S]
The returned type after indexing.
fn index(&'a self, i: Range<usize>) -> &'a [S]
[src]
Performs the indexing (container[index]
) operation.
impl<S> Index<usize> for Point2<S>
[src]
type Output = S
The returned type after indexing.
ⓘImportant traits for &'a mut Wfn index(&'a self, i: usize) -> &'a S
[src]
Performs the indexing (container[index]
) operation.
impl<S> Index<RangeTo<usize>> for Point2<S>
[src]
type Output = [S]
The returned type after indexing.
fn index(&'a self, i: RangeTo<usize>) -> &'a [S]
[src]
Performs the indexing (container[index]
) operation.
impl<S> MetricSpace for Point2<S> where
S: BaseFloat,
[src]
S: BaseFloat,
type Metric = S
The metric to be returned by the distance
function.
fn distance2(self, other: Point2<S>) -> S
[src]
Returns the squared distance. Read more
fn distance(self, other: Self) -> Self::Metric
[src]
The distance between two values.
impl<S> AsRef<(S, S)> for Point2<S>
[src]
impl<S> AsRef<[S; 2]> for Point2<S>
[src]
impl<S> Bounded for Point2<S> where
S: Bounded,
[src]
S: Bounded,
fn min_value() -> Point2<S>
[src]
returns the smallest finite number this type can represent
fn max_value() -> Point2<S>
[src]
returns the largest finite number this type can represent
impl<S> Transform<Point2<S>> for Matrix3<S> where
S: BaseFloat,
[src]
S: BaseFloat,
fn one() -> Matrix3<S>
[src]
Create an identity transformation. That is, a transformation which does nothing. Read more
fn look_at(eye: Point2<S>, center: Point2<S>, up: Vector2<S>) -> Matrix3<S>
[src]
Create a transformation that rotates a vector to look at center
from eye
, using up
for orientation. Read more
fn transform_vector(&self, vec: Vector2<S>) -> Vector2<S>
[src]
Transform a vector using this transform.
fn transform_point(&self, point: Point2<S>) -> Point2<S>
[src]
Transform a point using this transform.
fn concat(&self, other: &Matrix3<S>) -> Matrix3<S>
[src]
Combine this transform with another, yielding a new transformation which has the effects of both. Read more
fn inverse_transform(&self) -> Option<Matrix3<S>>
[src]
Create a transform that "un-does" this one.
fn inverse_transform_vector(
&self,
vec: <P as EuclideanSpace>::Diff
) -> Option<<P as EuclideanSpace>::Diff>
[src]
&self,
vec: <P as EuclideanSpace>::Diff
) -> Option<<P as EuclideanSpace>::Diff>
Inverse transform a vector using this transform
fn concat_self(&mut self, other: &Self)
[src]
Combine this transform with another, in-place.
impl<S> EuclideanSpace for Point2<S> where
S: BaseNum,
[src]
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() -> Point2<S>
[src]
The point at the origin of the Euclidean space.
fn from_vec(v: Vector2<S>) -> Point2<S>
[src]
Convert a displacement vector to a point. Read more
fn to_vec(self) -> Vector2<S>
[src]
Convert a point to a displacement vector. Read more
fn dot(self, v: Vector2<S>) -> S
[src]
This is a weird one, but its useful for plane calculations.
fn midpoint(self, other: Self) -> Self
[src]
Returns the middle point between two other points. Read more
fn centroid(points: &[Self]) -> Self
[src]
Returns the average position of all points in the slice. Read more
impl<S> SubAssign<Vector2<S>> for Point2<S> where
S: BaseNum + SubAssign<S>,
[src]
S: BaseNum + SubAssign<S>,
fn sub_assign(&mut self, vector: Vector2<S>)
[src]
Performs the -=
operation.
impl Div<Point2<u16>> for u16
[src]
type Output = Point2<u16>
The resulting type after applying the /
operator.
fn div(self, other: Point2<u16>) -> Point2<u16>
[src]
Performs the /
operation.
impl Div<Point2<i32>> for i32
[src]
type Output = Point2<i32>
The resulting type after applying the /
operator.
fn div(self, other: Point2<i32>) -> Point2<i32>
[src]
Performs the /
operation.
impl<'a> Div<&'a Point2<usize>> for usize
[src]
type Output = Point2<usize>
The resulting type after applying the /
operator.
fn div(self, other: &'a Point2<usize>) -> Point2<usize>
[src]
Performs the /
operation.
impl<'a> Div<&'a Point2<isize>> for isize
[src]
type Output = Point2<isize>
The resulting type after applying the /
operator.
fn div(self, other: &'a Point2<isize>) -> Point2<isize>
[src]
Performs the /
operation.
impl<'a> Div<&'a Point2<i64>> for i64
[src]
type Output = Point2<i64>
The resulting type after applying the /
operator.
fn div(self, other: &'a Point2<i64>) -> Point2<i64>
[src]
Performs the /
operation.
impl<'a> Div<&'a Point2<u64>> for u64
[src]
type Output = Point2<u64>
The resulting type after applying the /
operator.
fn div(self, other: &'a Point2<u64>) -> Point2<u64>
[src]
Performs the /
operation.
impl Div<Point2<u32>> for u32
[src]
type Output = Point2<u32>
The resulting type after applying the /
operator.
fn div(self, other: Point2<u32>) -> Point2<u32>
[src]
Performs the /
operation.
impl Div<Point2<i8>> for i8
[src]
type Output = Point2<i8>
The resulting type after applying the /
operator.
fn div(self, other: Point2<i8>) -> Point2<i8>
[src]
Performs the /
operation.
impl<'a> Div<&'a Point2<f32>> for f32
[src]
type Output = Point2<f32>
The resulting type after applying the /
operator.
fn div(self, other: &'a Point2<f32>) -> Point2<f32>
[src]
Performs the /
operation.
impl Div<Point2<f64>> for f64
[src]
type Output = Point2<f64>
The resulting type after applying the /
operator.
fn div(self, other: Point2<f64>) -> Point2<f64>
[src]
Performs the /
operation.
impl<'a> Div<&'a Point2<u16>> for u16
[src]
type Output = Point2<u16>
The resulting type after applying the /
operator.
fn div(self, other: &'a Point2<u16>) -> Point2<u16>
[src]
Performs the /
operation.
impl Div<Point2<i16>> for i16
[src]
type Output = Point2<i16>
The resulting type after applying the /
operator.
fn div(self, other: Point2<i16>) -> Point2<i16>
[src]
Performs the /
operation.
impl<'a, S> Div<S> for &'a Point2<S> where
S: BaseNum,
[src]
S: BaseNum,
type Output = Point2<S>
The resulting type after applying the /
operator.
fn div(self, other: S) -> Point2<S>
[src]
Performs the /
operation.
impl<'a> Div<&'a Point2<u32>> for u32
[src]
type Output = Point2<u32>
The resulting type after applying the /
operator.
fn div(self, other: &'a Point2<u32>) -> Point2<u32>
[src]
Performs the /
operation.
impl Div<Point2<i64>> for i64
[src]
type Output = Point2<i64>
The resulting type after applying the /
operator.
fn div(self, other: Point2<i64>) -> Point2<i64>
[src]
Performs the /
operation.
impl Div<Point2<f32>> for f32
[src]
type Output = Point2<f32>
The resulting type after applying the /
operator.
fn div(self, other: Point2<f32>) -> Point2<f32>
[src]
Performs the /
operation.
impl<'a> Div<&'a Point2<i32>> for i32
[src]
type Output = Point2<i32>
The resulting type after applying the /
operator.
fn div(self, other: &'a Point2<i32>) -> Point2<i32>
[src]
Performs the /
operation.
impl Div<Point2<usize>> for usize
[src]
type Output = Point2<usize>
The resulting type after applying the /
operator.
fn div(self, other: Point2<usize>) -> Point2<usize>
[src]
Performs the /
operation.
impl<'a> Div<&'a Point2<i16>> for i16
[src]
type Output = Point2<i16>
The resulting type after applying the /
operator.
fn div(self, other: &'a Point2<i16>) -> Point2<i16>
[src]
Performs the /
operation.
impl<'a> Div<&'a Point2<f64>> for f64
[src]
type Output = Point2<f64>
The resulting type after applying the /
operator.
fn div(self, other: &'a Point2<f64>) -> Point2<f64>
[src]
Performs the /
operation.
impl<S> Div<S> for Point2<S> where
S: BaseNum,
[src]
S: BaseNum,
type Output = Point2<S>
The resulting type after applying the /
operator.
fn div(self, other: S) -> Point2<S>
[src]
Performs the /
operation.
impl Div<Point2<u8>> for u8
[src]
type Output = Point2<u8>
The resulting type after applying the /
operator.
fn div(self, other: Point2<u8>) -> Point2<u8>
[src]
Performs the /
operation.
impl Div<Point2<u64>> for u64
[src]
type Output = Point2<u64>
The resulting type after applying the /
operator.
fn div(self, other: Point2<u64>) -> Point2<u64>
[src]
Performs the /
operation.
impl<'a> Div<&'a Point2<i8>> for i8
[src]
type Output = Point2<i8>
The resulting type after applying the /
operator.
fn div(self, other: &'a Point2<i8>) -> Point2<i8>
[src]
Performs the /
operation.
impl Div<Point2<isize>> for isize
[src]
type Output = Point2<isize>
The resulting type after applying the /
operator.
fn div(self, other: Point2<isize>) -> Point2<isize>
[src]
Performs the /
operation.
impl<'a> Div<&'a Point2<u8>> for u8
[src]
type Output = Point2<u8>
The resulting type after applying the /
operator.
fn div(self, other: &'a Point2<u8>) -> Point2<u8>
[src]
Performs the /
operation.
impl<S> Eq for Point2<S> where
S: Eq,
[src]
S: Eq,
impl<S> DivAssign<S> for Point2<S> where
S: BaseNum + DivAssign<S>,
[src]
S: BaseNum + DivAssign<S>,
fn div_assign(&mut self, scalar: S)
[src]
Performs the /=
operation.
impl<S> Hash for Point2<S> where
S: Hash,
[src]
S: Hash,
fn hash<__HS>(&self, __arg_0: &mut __HS) where
__HS: Hasher,
[src]
__HS: Hasher,
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]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<'a, S> From<&'a [S; 2]> for &'a Point2<S>
[src]
impl<'a, S> From<&'a (S, S)> for &'a Point2<S>
[src]
impl<'a, S> From<&'a mut (S, S)> for &'a mut Point2<S>
[src]
impl<S> From<[S; 2]> for Point2<S> where
S: Clone,
[src]
S: Clone,
impl<'a, S> From<&'a mut [S; 2]> for &'a mut Point2<S>
[src]
impl<S> From<(S, S)> for Point2<S>
[src]
impl<'de, S> Deserialize<'de> for Point2<S> where
S: Deserialize<'de>,
[src]
S: Deserialize<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<Point2<S>, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
[src]
__deserializer: __D
) -> Result<Point2<S>, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl<S> Serialize for Point2<S> where
S: Serialize,
[src]
S: Serialize,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
[src]
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<S> Debug for Point2<S> where
S: Debug,
[src]
S: Debug,
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
Formats the value using the given formatter. Read more
impl<S> Rotation<Point2<S>> for Basis2<S> where
S: BaseFloat,
[src]
S: BaseFloat,
fn look_at(dir: Vector2<S>, up: Vector2<S>) -> Basis2<S>
[src]
Create a rotation to a given direction with an 'up' vector.
fn between_vectors(a: Vector2<S>, b: Vector2<S>) -> Basis2<S>
[src]
Create a shortest rotation to transform vector 'a' into 'b'. Both given vectors are assumed to have unit length. Read more
fn rotate_vector(&self, vec: Vector2<S>) -> Vector2<S>
[src]
Rotate a vector using this rotation.
fn invert(&self) -> Basis2<S>
[src]
Create a new rotation which "un-does" this rotation. That is, r * r.invert()
is the identity. Read more
fn rotate_point(&self, point: P) -> P
[src]
Rotate a point using this rotation, by converting it to its representation as a vector. Read more
impl<S> IntoPoint<S> for Point2<S> where
S: BaseFloat,
[src]
S: BaseFloat,
fn into_point(self) -> Point<S>
[src]
Convert self into a Point
.
impl<S> Vertex for Point2<S> where
S: BaseNum,
[src]
S: BaseNum,
type Scalar = S
The values used to describe the vertex position.
impl<S> Vertex2d for Point2<S> where
S: BaseNum,
[src]
S: BaseNum,