[][src]Struct cgmath::Point2

#[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: Sy: S

Methods

impl<S> Point2<S>[src]

pub const 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]

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

impl<S: NumCast + Copy> Point2<S>[src]

pub fn cast<T: NumCast>(&self) -> Option<Point2<T>>[src]

Component-wise casting to another type

Trait Implementations

impl<S: BaseNum> Array for Point2<S>[src]

type Element = S

impl<S: BaseNum> ElementWise<Point2<S>> for Point2<S>[src]

impl<S: BaseNum> ElementWise<S> for Point2<S>[src]

impl<S: BaseFloat> MetricSpace for Point2<S>[src]

type Metric = S

The metric to be returned by the distance function.

impl<S: BaseNum> EuclideanSpace for Point2<S>[src]

type Scalar = S

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

type Diff = Vector2<S>

The associated space of displacement vectors.

impl<S: BaseFloat> Rotation<Point2<S>> for Basis2<S>[src]

impl<S: BaseFloat> Transform<Point2<S>> for Matrix3<S>[src]

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

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

impl<S: Eq> Eq for Point2<S>[src]

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

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

impl<S: Clone> Clone for Point2<S>[src]

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

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

impl<S: PartialEq> PartialEq<Point2<S>> for Point2<S>[src]

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

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

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

impl<S> From<(S, S)> for 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: Copy> Copy for Point2<S>[src]

impl<S: Hash> Hash for Point2<S>[src]

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

type Output = Point2<S>

The resulting type after applying the + operator.

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

type Output = Point2<S>

The resulting type after applying the + operator.

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

type Output = Point2<S>

The resulting type after applying the + operator.

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

type Output = Point2<S>

The resulting type after applying the + operator.

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

type Output = Point2<S>

The resulting type after applying the - operator.

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

type Output = Point2<S>

The resulting type after applying the - operator.

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

type Output = Point2<S>

The resulting type after applying the - operator.

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

type Output = Point2<S>

The resulting type after applying the - operator.

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

type Output = Vector2<S>

The resulting type after applying the - operator.

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

type Output = Vector2<S>

The resulting type after applying the - operator.

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

type Output = Vector2<S>

The resulting type after applying the - operator.

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

type Output = Vector2<S>

The resulting type after applying the - operator.

impl<S: BaseNum> Mul<S> for Point2<S>[src]

type Output = Point2<S>

The resulting type after applying the * operator.

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

type Output = Point2<S>

The resulting type after applying the * operator.

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

type Output = Point2<usize>

The resulting type after applying the * operator.

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

type Output = Point2<usize>

The resulting type after applying the * operator.

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

type Output = Point2<u8>

The resulting type after applying the * operator.

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

type Output = Point2<u8>

The resulting type after applying the * operator.

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

type Output = Point2<u16>

The resulting type after applying the * operator.

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

type Output = Point2<u16>

The resulting type after applying the * operator.

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

type Output = Point2<u32>

The resulting type after applying the * operator.

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

type Output = Point2<u32>

The resulting type after applying the * operator.

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

type Output = Point2<u64>

The resulting type after applying the * operator.

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

type Output = Point2<u64>

The resulting type after applying the * operator.

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

type Output = Point2<isize>

The resulting type after applying the * operator.

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

type Output = Point2<isize>

The resulting type after applying the * operator.

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

type Output = Point2<i8>

The resulting type after applying the * operator.

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

type Output = Point2<i8>

The resulting type after applying the * operator.

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

type Output = Point2<i16>

The resulting type after applying the * operator.

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

type Output = Point2<i16>

The resulting type after applying the * operator.

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

type Output = Point2<i32>

The resulting type after applying the * operator.

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

type Output = Point2<i32>

The resulting type after applying the * operator.

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

type Output = Point2<i64>

The resulting type after applying the * operator.

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

type Output = Point2<i64>

The resulting type after applying the * operator.

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

type Output = Point2<f32>

The resulting type after applying the * operator.

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

type Output = Point2<f32>

The resulting type after applying the * operator.

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

type Output = Point2<f64>

The resulting type after applying the * operator.

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

type Output = Point2<f64>

The resulting type after applying the * operator.

impl<S: BaseNum> Div<S> for Point2<S>[src]

type Output = Point2<S>

The resulting type after applying the / operator.

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

type Output = Point2<S>

The resulting type after applying the / operator.

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

type Output = Point2<usize>

The resulting type after applying the / operator.

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

type Output = Point2<usize>

The resulting type after applying the / operator.

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

type Output = Point2<u8>

The resulting type after applying the / operator.

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

type Output = Point2<u8>

The resulting type after applying the / operator.

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

type Output = Point2<u16>

The resulting type after applying the / operator.

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

type Output = Point2<u16>

The resulting type after applying the / operator.

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

type Output = Point2<u32>

The resulting type after applying the / operator.

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

type Output = Point2<u32>

The resulting type after applying the / operator.

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

type Output = Point2<u64>

The resulting type after applying the / operator.

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

type Output = Point2<u64>

The resulting type after applying the / operator.

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

type Output = Point2<isize>

The resulting type after applying the / operator.

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

type Output = Point2<isize>

The resulting type after applying the / operator.

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

type Output = Point2<i8>

The resulting type after applying the / operator.

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

type Output = Point2<i8>

The resulting type after applying the / operator.

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

type Output = Point2<i16>

The resulting type after applying the / operator.

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

type Output = Point2<i16>

The resulting type after applying the / operator.

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

type Output = Point2<i32>

The resulting type after applying the / operator.

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

type Output = Point2<i32>

The resulting type after applying the / operator.

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

type Output = Point2<i64>

The resulting type after applying the / operator.

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

type Output = Point2<i64>

The resulting type after applying the / operator.

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

type Output = Point2<f32>

The resulting type after applying the / operator.

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

type Output = Point2<f32>

The resulting type after applying the / operator.

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

type Output = Point2<f64>

The resulting type after applying the / operator.

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

type Output = Point2<f64>

The resulting type after applying the / operator.

impl<S: BaseNum> Rem<S> for Point2<S>[src]

type Output = Point2<S>

The resulting type after applying the % operator.

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

type Output = Point2<S>

The resulting type after applying the % operator.

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

type Output = Point2<usize>

The resulting type after applying the % operator.

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

type Output = Point2<usize>

The resulting type after applying the % operator.

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

type Output = Point2<u8>

The resulting type after applying the % operator.

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

type Output = Point2<u8>

The resulting type after applying the % operator.

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

type Output = Point2<u16>

The resulting type after applying the % operator.

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

type Output = Point2<u16>

The resulting type after applying the % operator.

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

type Output = Point2<u32>

The resulting type after applying the % operator.

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

type Output = Point2<u32>

The resulting type after applying the % operator.

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

type Output = Point2<u64>

The resulting type after applying the % operator.

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

type Output = Point2<u64>

The resulting type after applying the % operator.

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

type Output = Point2<isize>

The resulting type after applying the % operator.

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

type Output = Point2<isize>

The resulting type after applying the % operator.

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

type Output = Point2<i8>

The resulting type after applying the % operator.

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

type Output = Point2<i8>

The resulting type after applying the % operator.

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

type Output = Point2<i16>

The resulting type after applying the % operator.

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

type Output = Point2<i16>

The resulting type after applying the % operator.

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

type Output = Point2<i32>

The resulting type after applying the % operator.

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

type Output = Point2<i32>

The resulting type after applying the % operator.

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

type Output = Point2<i64>

The resulting type after applying the % operator.

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

type Output = Point2<i64>

The resulting type after applying the % operator.

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

type Output = Point2<f32>

The resulting type after applying the % operator.

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

type Output = Point2<f32>

The resulting type after applying the % operator.

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

type Output = Point2<f64>

The resulting type after applying the % operator.

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

type Output = Point2<f64>

The resulting type after applying the % operator.

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

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

impl<S: BaseNum + MulAssign<S>> MulAssign<S> for Point2<S>[src]

impl<S: BaseNum + DivAssign<S>> DivAssign<S> for Point2<S>[src]

impl<S: BaseNum + RemAssign<S>> RemAssign<S> for Point2<S>[src]

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

type Output = S

The returned type after indexing.

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

type Output = [S]

The returned type after indexing.

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

type Output = [S]

The returned type after indexing.

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

type Output = [S]

The returned type after indexing.

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

type Output = [S]

The returned type after indexing.

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

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

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

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

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

impl<S: Debug> Debug for Point2<S>[src]

impl<S: BaseFloat> AbsDiffEq<Point2<S>> for Point2<S>[src]

type Epsilon = S::Epsilon

Used for specifying relative comparisons.

impl<S: BaseFloat> RelativeEq<Point2<S>> for Point2<S>[src]

impl<S: BaseFloat> UlpsEq<Point2<S>> for Point2<S>[src]

impl<S: Bounded> Bounded for Point2<S>[src]

Auto Trait Implementations

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

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

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

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

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

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T, Rhs, Output> NumOps<Rhs, Output> for T where
    T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>, 
[src]

impl<T, Rhs> NumAssignOps<Rhs> for T where
    T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>, 
[src]