Struct crayon::prelude::math::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

Methods

impl<S> Point2<S> where
    S: BaseNum
[src]

[src]

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

[src]

Component-wise casting to another type

Trait Implementations

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

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

[src]

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

1.3.0
[src]

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

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

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

The associated space of displacement vectors.

[src]

The point at the origin of the Euclidean space.

[src]

Convert a displacement vector to a point. Read more

[src]

Convert a point to a displacement vector. Read more

[src]

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

[src]

Returns the middle point between two other points. Read more

[src]

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

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

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

[src]

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

[src]

This method tests for !=.

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

Used for specifying relative comparisons.

[src]

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

[src]

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

[src]

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

[src]

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

[src]

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

The inverse of ApproxEq::relative_eq.

The inverse of ApproxEq::ulps_eq.

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

[src]

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

[src]

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

[src]

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

[src]

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

[src]

Formats the value using the given formatter.

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

[src]

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

[src]

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

[src]

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

[src]

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

[src]

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

[src]

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

[src]

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

[src]

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

[src]

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

[src]

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

[src]

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

[src]

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

[src]

The sum of the elements of the array.

[src]

The product of the elements of the array.

[src]

Get the pointer to the first element of the array.

[src]

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

[src]

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

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

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

[src]

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

[src]

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

[src]

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

[src]

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

The metric to be returned by the distance function.

[src]

Returns the squared distance. Read more

[src]

The distance between two values.

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

[src]

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

[src]

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

[src]

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

[src]

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

[src]

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

[src]

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

[src]

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

[src]

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

[src]

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

[src]

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

[src]