Struct cgmath::Point2

source ·
#[repr(C)]
pub struct Point2<S> { pub x: S, pub y: S, }
Expand description

A point in 2-dimensional space.

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

Fields§

§x: S§y: S

Implementations§

source§

impl<S: BaseNum> Point2<S>

source

pub fn new(x: S, y: S) -> Point2<S>

source§

impl<S: NumCast + Copy> Point2<S>

source

pub fn cast<T: NumCast>(&self) -> Point2<T>

Component-wise casting to another type

Trait Implementations§

source§

impl<'a, 'b, S: BaseNum> Add<&'a Vector2<S>> for &'b Point2<S>

§

type Output = Point2<S>

The resulting type after applying the + operator.
source§

fn add(self, other: &'a Vector2<S>) -> Point2<S>

Performs the + operation. Read more
source§

impl<'a, S: BaseNum> Add<&'a Vector2<S>> for Point2<S>

§

type Output = Point2<S>

The resulting type after applying the + operator.
source§

fn add(self, other: &'a Vector2<S>) -> Point2<S>

Performs the + operation. Read more
source§

impl<'a, S: BaseNum> Add<Vector2<S>> for &'a Point2<S>

§

type Output = Point2<S>

The resulting type after applying the + operator.
source§

fn add(self, other: Vector2<S>) -> Point2<S>

Performs the + operation. Read more
source§

impl<S: BaseNum> Add<Vector2<S>> for Point2<S>

§

type Output = Point2<S>

The resulting type after applying the + operator.
source§

fn add(self, other: Vector2<S>) -> Point2<S>

Performs the + operation. Read more
source§

impl<S: BaseNum + AddAssign<S>> AddAssign<Vector2<S>> for Point2<S>

source§

fn add_assign(&mut self, vector: Vector2<S>)

Performs the += operation. Read more
source§

impl<S: BaseFloat> ApproxEq for Point2<S>

§

type Epsilon = <S as ApproxEq>::Epsilon

Used for specifying relative comparisons.
source§

fn default_epsilon() -> S::Epsilon

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

fn default_max_relative() -> S::Epsilon

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

fn default_max_ulps() -> u32

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

fn relative_eq( &self, other: &Self, epsilon: S::Epsilon, max_relative: S::Epsilon ) -> bool

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

fn ulps_eq(&self, other: &Self, epsilon: S::Epsilon, max_ulps: u32) -> bool

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

fn relative_ne( &self, other: &Self, epsilon: Self::Epsilon, max_relative: Self::Epsilon ) -> bool

The inverse of ApproxEq::relative_eq.
source§

fn ulps_ne(&self, other: &Self, epsilon: Self::Epsilon, max_ulps: u32) -> bool

The inverse of ApproxEq::ulps_eq.
source§

impl<S: BaseNum> Array for Point2<S>

§

type Element = S

source§

fn from_value(scalar: S) -> Point2<S>

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

fn sum(self) -> Swhere S: Add<Output = S>,

The sum of the elements of the array.
source§

fn product(self) -> Swhere S: Mul<Output = S>,

The product of the elements of the array.
source§

fn min(self) -> Swhere S: PartialOrd,

The minimum element of the array.
source§

fn max(self) -> Swhere S: PartialOrd,

The maximum element of the array.
source§

fn as_ptr(&self) -> *const Self::Element

Get the pointer to the first element of the array.
source§

fn as_mut_ptr(&mut self) -> *mut Self::Element

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

fn swap_elements(&mut self, i: usize, j: usize)

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

impl<S> AsMut<[S; 2]> for Point2<S>

source§

fn as_mut(&mut self) -> &mut [S; 2]

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<S> AsMut<(S, S)> for Point2<S>

source§

fn as_mut(&mut self) -> &mut (S, S)

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<S> AsRef<[S; 2]> for Point2<S>

source§

fn as_ref(&self) -> &[S; 2]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<S> AsRef<(S, S)> for Point2<S>

source§

fn as_ref(&self) -> &(S, S)

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<S: Clone> Clone for Point2<S>

source§

fn clone(&self) -> Point2<S>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<S: Debug> Debug for Point2<S>

source§

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

Formats the value using the given formatter. Read more
source§

impl<'a> Div<&'a Point2<f32>> for f32

§

type Output = Point2<f32>

The resulting type after applying the / operator.
source§

fn div(self, other: &'a Point2<f32>) -> Point2<f32>

Performs the / operation. Read more
source§

impl<'a> Div<&'a Point2<f64>> for f64

§

type Output = Point2<f64>

The resulting type after applying the / operator.
source§

fn div(self, other: &'a Point2<f64>) -> Point2<f64>

Performs the / operation. Read more
source§

impl<'a> Div<&'a Point2<i16>> for i16

§

type Output = Point2<i16>

The resulting type after applying the / operator.
source§

fn div(self, other: &'a Point2<i16>) -> Point2<i16>

Performs the / operation. Read more
source§

impl<'a> Div<&'a Point2<i32>> for i32

§

type Output = Point2<i32>

The resulting type after applying the / operator.
source§

fn div(self, other: &'a Point2<i32>) -> Point2<i32>

Performs the / operation. Read more
source§

impl<'a> Div<&'a Point2<i64>> for i64

§

type Output = Point2<i64>

The resulting type after applying the / operator.
source§

fn div(self, other: &'a Point2<i64>) -> Point2<i64>

Performs the / operation. Read more
source§

impl<'a> Div<&'a Point2<i8>> for i8

§

type Output = Point2<i8>

The resulting type after applying the / operator.
source§

fn div(self, other: &'a Point2<i8>) -> Point2<i8>

Performs the / operation. Read more
source§

impl<'a> Div<&'a Point2<isize>> for isize

§

type Output = Point2<isize>

The resulting type after applying the / operator.
source§

fn div(self, other: &'a Point2<isize>) -> Point2<isize>

Performs the / operation. Read more
source§

impl<'a> Div<&'a Point2<u16>> for u16

§

type Output = Point2<u16>

The resulting type after applying the / operator.
source§

fn div(self, other: &'a Point2<u16>) -> Point2<u16>

Performs the / operation. Read more
source§

impl<'a> Div<&'a Point2<u32>> for u32

§

type Output = Point2<u32>

The resulting type after applying the / operator.
source§

fn div(self, other: &'a Point2<u32>) -> Point2<u32>

Performs the / operation. Read more
source§

impl<'a> Div<&'a Point2<u64>> for u64

§

type Output = Point2<u64>

The resulting type after applying the / operator.
source§

fn div(self, other: &'a Point2<u64>) -> Point2<u64>

Performs the / operation. Read more
source§

impl<'a> Div<&'a Point2<u8>> for u8

§

type Output = Point2<u8>

The resulting type after applying the / operator.
source§

fn div(self, other: &'a Point2<u8>) -> Point2<u8>

Performs the / operation. Read more
source§

impl<'a> Div<&'a Point2<usize>> for usize

§

type Output = Point2<usize>

The resulting type after applying the / operator.
source§

fn div(self, other: &'a Point2<usize>) -> Point2<usize>

Performs the / operation. Read more
source§

impl Div<Point2<f32>> for f32

§

type Output = Point2<f32>

The resulting type after applying the / operator.
source§

fn div(self, other: Point2<f32>) -> Point2<f32>

Performs the / operation. Read more
source§

impl Div<Point2<f64>> for f64

§

type Output = Point2<f64>

The resulting type after applying the / operator.
source§

fn div(self, other: Point2<f64>) -> Point2<f64>

Performs the / operation. Read more
source§

impl Div<Point2<i16>> for i16

§

type Output = Point2<i16>

The resulting type after applying the / operator.
source§

fn div(self, other: Point2<i16>) -> Point2<i16>

Performs the / operation. Read more
source§

impl Div<Point2<i32>> for i32

§

type Output = Point2<i32>

The resulting type after applying the / operator.
source§

fn div(self, other: Point2<i32>) -> Point2<i32>

Performs the / operation. Read more
source§

impl Div<Point2<i64>> for i64

§

type Output = Point2<i64>

The resulting type after applying the / operator.
source§

fn div(self, other: Point2<i64>) -> Point2<i64>

Performs the / operation. Read more
source§

impl Div<Point2<i8>> for i8

§

type Output = Point2<i8>

The resulting type after applying the / operator.
source§

fn div(self, other: Point2<i8>) -> Point2<i8>

Performs the / operation. Read more
source§

impl Div<Point2<isize>> for isize

§

type Output = Point2<isize>

The resulting type after applying the / operator.
source§

fn div(self, other: Point2<isize>) -> Point2<isize>

Performs the / operation. Read more
source§

impl Div<Point2<u16>> for u16

§

type Output = Point2<u16>

The resulting type after applying the / operator.
source§

fn div(self, other: Point2<u16>) -> Point2<u16>

Performs the / operation. Read more
source§

impl Div<Point2<u32>> for u32

§

type Output = Point2<u32>

The resulting type after applying the / operator.
source§

fn div(self, other: Point2<u32>) -> Point2<u32>

Performs the / operation. Read more
source§

impl Div<Point2<u64>> for u64

§

type Output = Point2<u64>

The resulting type after applying the / operator.
source§

fn div(self, other: Point2<u64>) -> Point2<u64>

Performs the / operation. Read more
source§

impl Div<Point2<u8>> for u8

§

type Output = Point2<u8>

The resulting type after applying the / operator.
source§

fn div(self, other: Point2<u8>) -> Point2<u8>

Performs the / operation. Read more
source§

impl Div<Point2<usize>> for usize

§

type Output = Point2<usize>

The resulting type after applying the / operator.
source§

fn div(self, other: Point2<usize>) -> Point2<usize>

Performs the / operation. Read more
source§

impl<'a, S: BaseNum> Div<S> for &'a Point2<S>

§

type Output = Point2<S>

The resulting type after applying the / operator.
source§

fn div(self, other: S) -> Point2<S>

Performs the / operation. Read more
source§

impl<S: BaseNum> Div<S> for Point2<S>

§

type Output = Point2<S>

The resulting type after applying the / operator.
source§

fn div(self, other: S) -> Point2<S>

Performs the / operation. Read more
source§

impl<S: BaseNum + DivAssign<S>> DivAssign<S> for Point2<S>

source§

fn div_assign(&mut self, scalar: S)

Performs the /= operation. Read more
source§

impl<S: BaseNum> EuclideanSpace for Point2<S>

§

type Scalar = S

The associated scalar over which the space is defined. Read more
§

type Diff = Vector2<S>

The associated space of displacement vectors.
source§

fn origin() -> Point2<S>

The point at the origin of the Euclidean space.
source§

fn from_vec(v: Vector2<S>) -> Point2<S>

Convert a displacement vector to a point. Read more
source§

fn to_vec(self) -> Vector2<S>

Convert a point to a displacement vector. Read more
source§

fn dot(self, v: Vector2<S>) -> S

This is a weird one, but its useful for plane calculations.
source§

fn midpoint(self, other: Self) -> Self

Returns the middle point between two other points. Read more
source§

fn centroid(points: &[Self]) -> Self

Returns the average position of all points in the slice. Read more
source§

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

source§

fn from(v: &'a [S; 2]) -> &'a Point2<S>

Converts to this type from the input type.
source§

impl<'a, S> From<&'a (S, S)> for &'a Point2<S>

source§

fn from(v: &'a (S, S)) -> &'a Point2<S>

Converts to this type from the input type.
source§

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

source§

fn from(v: &'a mut [S; 2]) -> &'a mut Point2<S>

Converts to this type from the input type.
source§

impl<'a, S> From<&'a mut (S, S)> for &'a mut Point2<S>

source§

fn from(v: &'a mut (S, S)) -> &'a mut Point2<S>

Converts to this type from the input type.
source§

impl<S: Clone> From<[S; 2]> for Point2<S>

source§

fn from(v: [S; 2]) -> Point2<S>

Converts to this type from the input type.
source§

impl<S> From<(S, S)> for Point2<S>

source§

fn from(v: (S, S)) -> Point2<S>

Converts to this type from the input type.
source§

impl<S: Hash> Hash for Point2<S>

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<S> Index<Range<usize>> for Point2<S>

§

type Output = [S]

The returned type after indexing.
source§

fn index<'a>(&'a self, i: Range<usize>) -> &'a [S]

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

impl<S> Index<RangeFrom<usize>> for Point2<S>

§

type Output = [S]

The returned type after indexing.
source§

fn index<'a>(&'a self, i: RangeFrom<usize>) -> &'a [S]

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

impl<S> Index<RangeFull> for Point2<S>

§

type Output = [S]

The returned type after indexing.
source§

fn index<'a>(&'a self, i: RangeFull) -> &'a [S]

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

impl<S> Index<RangeTo<usize>> for Point2<S>

§

type Output = [S]

The returned type after indexing.
source§

fn index<'a>(&'a self, i: RangeTo<usize>) -> &'a [S]

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

impl<S> Index<usize> for Point2<S>

§

type Output = S

The returned type after indexing.
source§

fn index<'a>(&'a self, i: usize) -> &'a S

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

impl<S> IndexMut<Range<usize>> for Point2<S>

source§

fn index_mut<'a>(&'a mut self, i: Range<usize>) -> &'a mut [S]

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

impl<S> IndexMut<RangeFrom<usize>> for Point2<S>

source§

fn index_mut<'a>(&'a mut self, i: RangeFrom<usize>) -> &'a mut [S]

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

impl<S> IndexMut<RangeFull> for Point2<S>

source§

fn index_mut<'a>(&'a mut self, i: RangeFull) -> &'a mut [S]

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

impl<S> IndexMut<RangeTo<usize>> for Point2<S>

source§

fn index_mut<'a>(&'a mut self, i: RangeTo<usize>) -> &'a mut [S]

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

impl<S> IndexMut<usize> for Point2<S>

source§

fn index_mut<'a>(&'a mut self, i: usize) -> &'a mut S

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

impl<S> Into<[S; 2]> for Point2<S>

source§

fn into(self) -> [S; 2]

Converts this type into the (usually inferred) input type.
source§

impl<S> Into<(S, S)> for Point2<S>

source§

fn into(self) -> (S, S)

Converts this type into the (usually inferred) input type.
source§

impl<S: BaseFloat> MetricSpace for Point2<S>

§

type Metric = S

The metric to be returned by the distance function.
source§

fn distance2(self, other: Self) -> S

Returns the squared distance. Read more
source§

fn distance(self, other: Self) -> Self::Metric

The distance between two values.
source§

impl<'a> Mul<&'a Point2<f32>> for f32

§

type Output = Point2<f32>

The resulting type after applying the * operator.
source§

fn mul(self, other: &'a Point2<f32>) -> Point2<f32>

Performs the * operation. Read more
source§

impl<'a> Mul<&'a Point2<f64>> for f64

§

type Output = Point2<f64>

The resulting type after applying the * operator.
source§

fn mul(self, other: &'a Point2<f64>) -> Point2<f64>

Performs the * operation. Read more
source§

impl<'a> Mul<&'a Point2<i16>> for i16

§

type Output = Point2<i16>

The resulting type after applying the * operator.
source§

fn mul(self, other: &'a Point2<i16>) -> Point2<i16>

Performs the * operation. Read more
source§

impl<'a> Mul<&'a Point2<i32>> for i32

§

type Output = Point2<i32>

The resulting type after applying the * operator.
source§

fn mul(self, other: &'a Point2<i32>) -> Point2<i32>

Performs the * operation. Read more
source§

impl<'a> Mul<&'a Point2<i64>> for i64

§

type Output = Point2<i64>

The resulting type after applying the * operator.
source§

fn mul(self, other: &'a Point2<i64>) -> Point2<i64>

Performs the * operation. Read more
source§

impl<'a> Mul<&'a Point2<i8>> for i8

§

type Output = Point2<i8>

The resulting type after applying the * operator.
source§

fn mul(self, other: &'a Point2<i8>) -> Point2<i8>

Performs the * operation. Read more
source§

impl<'a> Mul<&'a Point2<isize>> for isize

§

type Output = Point2<isize>

The resulting type after applying the * operator.
source§

fn mul(self, other: &'a Point2<isize>) -> Point2<isize>

Performs the * operation. Read more
source§

impl<'a> Mul<&'a Point2<u16>> for u16

§

type Output = Point2<u16>

The resulting type after applying the * operator.
source§

fn mul(self, other: &'a Point2<u16>) -> Point2<u16>

Performs the * operation. Read more
source§

impl<'a> Mul<&'a Point2<u32>> for u32

§

type Output = Point2<u32>

The resulting type after applying the * operator.
source§

fn mul(self, other: &'a Point2<u32>) -> Point2<u32>

Performs the * operation. Read more
source§

impl<'a> Mul<&'a Point2<u64>> for u64

§

type Output = Point2<u64>

The resulting type after applying the * operator.
source§

fn mul(self, other: &'a Point2<u64>) -> Point2<u64>

Performs the * operation. Read more
source§

impl<'a> Mul<&'a Point2<u8>> for u8

§

type Output = Point2<u8>

The resulting type after applying the * operator.
source§

fn mul(self, other: &'a Point2<u8>) -> Point2<u8>

Performs the * operation. Read more
source§

impl<'a> Mul<&'a Point2<usize>> for usize

§

type Output = Point2<usize>

The resulting type after applying the * operator.
source§

fn mul(self, other: &'a Point2<usize>) -> Point2<usize>

Performs the * operation. Read more
source§

impl Mul<Point2<f32>> for f32

§

type Output = Point2<f32>

The resulting type after applying the * operator.
source§

fn mul(self, other: Point2<f32>) -> Point2<f32>

Performs the * operation. Read more
source§

impl Mul<Point2<f64>> for f64

§

type Output = Point2<f64>

The resulting type after applying the * operator.
source§

fn mul(self, other: Point2<f64>) -> Point2<f64>

Performs the * operation. Read more
source§

impl Mul<Point2<i16>> for i16

§

type Output = Point2<i16>

The resulting type after applying the * operator.
source§

fn mul(self, other: Point2<i16>) -> Point2<i16>

Performs the * operation. Read more
source§

impl Mul<Point2<i32>> for i32

§

type Output = Point2<i32>

The resulting type after applying the * operator.
source§

fn mul(self, other: Point2<i32>) -> Point2<i32>

Performs the * operation. Read more
source§

impl Mul<Point2<i64>> for i64

§

type Output = Point2<i64>

The resulting type after applying the * operator.
source§

fn mul(self, other: Point2<i64>) -> Point2<i64>

Performs the * operation. Read more
source§

impl Mul<Point2<i8>> for i8

§

type Output = Point2<i8>

The resulting type after applying the * operator.
source§

fn mul(self, other: Point2<i8>) -> Point2<i8>

Performs the * operation. Read more
source§

impl Mul<Point2<isize>> for isize

§

type Output = Point2<isize>

The resulting type after applying the * operator.
source§

fn mul(self, other: Point2<isize>) -> Point2<isize>

Performs the * operation. Read more
source§

impl Mul<Point2<u16>> for u16

§

type Output = Point2<u16>

The resulting type after applying the * operator.
source§

fn mul(self, other: Point2<u16>) -> Point2<u16>

Performs the * operation. Read more
source§

impl Mul<Point2<u32>> for u32

§

type Output = Point2<u32>

The resulting type after applying the * operator.
source§

fn mul(self, other: Point2<u32>) -> Point2<u32>

Performs the * operation. Read more
source§

impl Mul<Point2<u64>> for u64

§

type Output = Point2<u64>

The resulting type after applying the * operator.
source§

fn mul(self, other: Point2<u64>) -> Point2<u64>

Performs the * operation. Read more
source§

impl Mul<Point2<u8>> for u8

§

type Output = Point2<u8>

The resulting type after applying the * operator.
source§

fn mul(self, other: Point2<u8>) -> Point2<u8>

Performs the * operation. Read more
source§

impl Mul<Point2<usize>> for usize

§

type Output = Point2<usize>

The resulting type after applying the * operator.
source§

fn mul(self, other: Point2<usize>) -> Point2<usize>

Performs the * operation. Read more
source§

impl<'a, S: BaseNum> Mul<S> for &'a Point2<S>

§

type Output = Point2<S>

The resulting type after applying the * operator.
source§

fn mul(self, other: S) -> Point2<S>

Performs the * operation. Read more
source§

impl<S: BaseNum> Mul<S> for Point2<S>

§

type Output = Point2<S>

The resulting type after applying the * operator.
source§

fn mul(self, other: S) -> Point2<S>

Performs the * operation. Read more
source§

impl<S: BaseNum + MulAssign<S>> MulAssign<S> for Point2<S>

source§

fn mul_assign(&mut self, scalar: S)

Performs the *= operation. Read more
source§

impl<S: PartialEq> PartialEq<Point2<S>> for Point2<S>

source§

fn eq(&self, other: &Point2<S>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'a> Rem<&'a Point2<f32>> for f32

§

type Output = Point2<f32>

The resulting type after applying the % operator.
source§

fn rem(self, other: &'a Point2<f32>) -> Point2<f32>

Performs the % operation. Read more
source§

impl<'a> Rem<&'a Point2<f64>> for f64

§

type Output = Point2<f64>

The resulting type after applying the % operator.
source§

fn rem(self, other: &'a Point2<f64>) -> Point2<f64>

Performs the % operation. Read more
source§

impl<'a> Rem<&'a Point2<i16>> for i16

§

type Output = Point2<i16>

The resulting type after applying the % operator.
source§

fn rem(self, other: &'a Point2<i16>) -> Point2<i16>

Performs the % operation. Read more
source§

impl<'a> Rem<&'a Point2<i32>> for i32

§

type Output = Point2<i32>

The resulting type after applying the % operator.
source§

fn rem(self, other: &'a Point2<i32>) -> Point2<i32>

Performs the % operation. Read more
source§

impl<'a> Rem<&'a Point2<i64>> for i64

§

type Output = Point2<i64>

The resulting type after applying the % operator.
source§

fn rem(self, other: &'a Point2<i64>) -> Point2<i64>

Performs the % operation. Read more
source§

impl<'a> Rem<&'a Point2<i8>> for i8

§

type Output = Point2<i8>

The resulting type after applying the % operator.
source§

fn rem(self, other: &'a Point2<i8>) -> Point2<i8>

Performs the % operation. Read more
source§

impl<'a> Rem<&'a Point2<isize>> for isize

§

type Output = Point2<isize>

The resulting type after applying the % operator.
source§

fn rem(self, other: &'a Point2<isize>) -> Point2<isize>

Performs the % operation. Read more
source§

impl<'a> Rem<&'a Point2<u16>> for u16

§

type Output = Point2<u16>

The resulting type after applying the % operator.
source§

fn rem(self, other: &'a Point2<u16>) -> Point2<u16>

Performs the % operation. Read more
source§

impl<'a> Rem<&'a Point2<u32>> for u32

§

type Output = Point2<u32>

The resulting type after applying the % operator.
source§

fn rem(self, other: &'a Point2<u32>) -> Point2<u32>

Performs the % operation. Read more
source§

impl<'a> Rem<&'a Point2<u64>> for u64

§

type Output = Point2<u64>

The resulting type after applying the % operator.
source§

fn rem(self, other: &'a Point2<u64>) -> Point2<u64>

Performs the % operation. Read more
source§

impl<'a> Rem<&'a Point2<u8>> for u8

§

type Output = Point2<u8>

The resulting type after applying the % operator.
source§

fn rem(self, other: &'a Point2<u8>) -> Point2<u8>

Performs the % operation. Read more
source§

impl<'a> Rem<&'a Point2<usize>> for usize

§

type Output = Point2<usize>

The resulting type after applying the % operator.
source§

fn rem(self, other: &'a Point2<usize>) -> Point2<usize>

Performs the % operation. Read more
source§

impl Rem<Point2<f32>> for f32

§

type Output = Point2<f32>

The resulting type after applying the % operator.
source§

fn rem(self, other: Point2<f32>) -> Point2<f32>

Performs the % operation. Read more
source§

impl Rem<Point2<f64>> for f64

§

type Output = Point2<f64>

The resulting type after applying the % operator.
source§

fn rem(self, other: Point2<f64>) -> Point2<f64>

Performs the % operation. Read more
source§

impl Rem<Point2<i16>> for i16

§

type Output = Point2<i16>

The resulting type after applying the % operator.
source§

fn rem(self, other: Point2<i16>) -> Point2<i16>

Performs the % operation. Read more
source§

impl Rem<Point2<i32>> for i32

§

type Output = Point2<i32>

The resulting type after applying the % operator.
source§

fn rem(self, other: Point2<i32>) -> Point2<i32>

Performs the % operation. Read more
source§

impl Rem<Point2<i64>> for i64

§

type Output = Point2<i64>

The resulting type after applying the % operator.
source§

fn rem(self, other: Point2<i64>) -> Point2<i64>

Performs the % operation. Read more
source§

impl Rem<Point2<i8>> for i8

§

type Output = Point2<i8>

The resulting type after applying the % operator.
source§

fn rem(self, other: Point2<i8>) -> Point2<i8>

Performs the % operation. Read more
source§

impl Rem<Point2<isize>> for isize

§

type Output = Point2<isize>

The resulting type after applying the % operator.
source§

fn rem(self, other: Point2<isize>) -> Point2<isize>

Performs the % operation. Read more
source§

impl Rem<Point2<u16>> for u16

§

type Output = Point2<u16>

The resulting type after applying the % operator.
source§

fn rem(self, other: Point2<u16>) -> Point2<u16>

Performs the % operation. Read more
source§

impl Rem<Point2<u32>> for u32

§

type Output = Point2<u32>

The resulting type after applying the % operator.
source§

fn rem(self, other: Point2<u32>) -> Point2<u32>

Performs the % operation. Read more
source§

impl Rem<Point2<u64>> for u64

§

type Output = Point2<u64>

The resulting type after applying the % operator.
source§

fn rem(self, other: Point2<u64>) -> Point2<u64>

Performs the % operation. Read more
source§

impl Rem<Point2<u8>> for u8

§

type Output = Point2<u8>

The resulting type after applying the % operator.
source§

fn rem(self, other: Point2<u8>) -> Point2<u8>

Performs the % operation. Read more
source§

impl Rem<Point2<usize>> for usize

§

type Output = Point2<usize>

The resulting type after applying the % operator.
source§

fn rem(self, other: Point2<usize>) -> Point2<usize>

Performs the % operation. Read more
source§

impl<'a, S: BaseNum> Rem<S> for &'a Point2<S>

§

type Output = Point2<S>

The resulting type after applying the % operator.
source§

fn rem(self, other: S) -> Point2<S>

Performs the % operation. Read more
source§

impl<S: BaseNum> Rem<S> for Point2<S>

§

type Output = Point2<S>

The resulting type after applying the % operator.
source§

fn rem(self, other: S) -> Point2<S>

Performs the % operation. Read more
source§

impl<S: BaseNum + RemAssign<S>> RemAssign<S> for Point2<S>

source§

fn rem_assign(&mut self, scalar: S)

Performs the %= operation. Read more
source§

impl<S: BaseFloat> Rotation<Point2<S>> for Basis2<S>

source§

fn look_at(dir: Vector2<S>, up: Vector2<S>) -> Basis2<S>

Create a rotation to a given direction with an ‘up’ vector.
source§

fn between_vectors(a: Vector2<S>, b: Vector2<S>) -> Basis2<S>

Create a shortest rotation to transform vector ‘a’ into ‘b’. Both given vectors are assumed to have unit length.
source§

fn rotate_vector(&self, vec: Vector2<S>) -> Vector2<S>

Rotate a vector using this rotation.
source§

fn invert(&self) -> Basis2<S>

Create a new rotation which “un-does” this rotation. That is, r * r.invert() is the identity.
source§

fn rotate_point(&self, point: P) -> P

Rotate a point using this rotation, by converting it to its representation as a vector.
source§

impl<'a, 'b, S: BaseNum> Sub<&'a Point2<S>> for &'b Point2<S>

§

type Output = Vector2<S>

The resulting type after applying the - operator.
source§

fn sub(self, other: &'a Point2<S>) -> Vector2<S>

Performs the - operation. Read more
source§

impl<'a, S: BaseNum> Sub<&'a Point2<S>> for Point2<S>

§

type Output = Vector2<S>

The resulting type after applying the - operator.
source§

fn sub(self, other: &'a Point2<S>) -> Vector2<S>

Performs the - operation. Read more
source§

impl<'a, S: BaseNum> Sub<Point2<S>> for &'a Point2<S>

§

type Output = Vector2<S>

The resulting type after applying the - operator.
source§

fn sub(self, other: Point2<S>) -> Vector2<S>

Performs the - operation. Read more
source§

impl<S: BaseNum> Sub<Point2<S>> for Point2<S>

§

type Output = Vector2<S>

The resulting type after applying the - operator.
source§

fn sub(self, other: Point2<S>) -> Vector2<S>

Performs the - operation. Read more
source§

impl<S: BaseFloat> Transform<Point2<S>> for Matrix3<S>

source§

fn one() -> Matrix3<S>

Create an identity transformation. That is, a transformation which does nothing.
source§

fn look_at(eye: Point2<S>, center: Point2<S>, up: Vector2<S>) -> Matrix3<S>

Create a transformation that rotates a vector to look at center from eye, using up for orientation.
source§

fn transform_vector(&self, vec: Vector2<S>) -> Vector2<S>

Transform a vector using this transform.
source§

fn transform_point(&self, point: Point2<S>) -> Point2<S>

Transform a point using this transform.
source§

fn concat(&self, other: &Matrix3<S>) -> Matrix3<S>

Combine this transform with another, yielding a new transformation which has the effects of both.
source§

fn inverse_transform(&self) -> Option<Matrix3<S>>

Create a transform that “un-does” this one.
source§

fn concat_self(&mut self, other: &Self)

Combine this transform with another, in-place.
source§

impl<S: Copy> Copy for Point2<S>

source§

impl<S: Eq> Eq for Point2<S>

source§

impl<S> StructuralEq for Point2<S>

source§

impl<S> StructuralPartialEq for Point2<S>

Auto Trait Implementations§

§

impl<S> RefUnwindSafe for Point2<S>where S: RefUnwindSafe,

§

impl<S> Send for Point2<S>where S: Send,

§

impl<S> Sync for Point2<S>where S: Sync,

§

impl<S> Unpin for Point2<S>where S: Unpin,

§

impl<S> UnwindSafe for Point2<S>where S: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

impl<T, Rhs, Output> NumOps<Rhs, Output> for Twhere T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,