Struct rusttype::Point [] [src]

pub struct Point<N> {
    pub x: N,
    pub y: N,
}

A point in 2-dimensional space, with each dimension of type N.

Legal operations on points are addition and subtraction by vectors, and subtraction between points, to give a vector representing the offset between the two points. Combined with the legal operations on vectors, meaningful manipulations of vectors and points can be performed.

For example, to interpolate between two points by a factor t:

let interpolated_point = p0 + (p1 - p0) * t;

Fields

x
y

Trait Implementations

impl<N: Sub<Output=N>> Sub for Point<N>

type Output = Vector<N>

fn sub(self, rhs: Point<N>) -> Vector<N>

impl<N: Add<Output=N>> Add<Vector<N>> for Point<N>

type Output = Point<N>

fn add(self, rhs: Vector<N>) -> Point<N>

impl<N: Sub<Output=N>> Sub<Vector<N>> for Point<N>

type Output = Point<N>

fn sub(self, rhs: Vector<N>) -> Point<N>

Derived Implementations

impl<N: Hash> Hash for Point<N>

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

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

impl<N: Eq> Eq for Point<N>

impl<N: PartialEq> PartialEq for Point<N>

fn eq(&self, __arg_0: &Point<N>) -> bool

fn ne(&self, __arg_0: &Point<N>) -> bool

impl<N: Ord> Ord for Point<N>

fn cmp(&self, __arg_0: &Point<N>) -> Ordering

impl<N: PartialOrd> PartialOrd for Point<N>

fn partial_cmp(&self, __arg_0: &Point<N>) -> Option<Ordering>

fn lt(&self, __arg_0: &Point<N>) -> bool

fn le(&self, __arg_0: &Point<N>) -> bool

fn gt(&self, __arg_0: &Point<N>) -> bool

fn ge(&self, __arg_0: &Point<N>) -> bool

impl<N: Debug> Debug for Point<N>

fn fmt(&self, __arg_0: &mut Formatter) -> Result

impl<N: Clone> Clone for Point<N>

fn clone(&self) -> Point<N>

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

impl<N: Copy> Copy for Point<N>