Struct euclid::point::Point2D [] [src]

pub struct Point2D<T> {
    pub x: T,
    pub y: T,
}

Fields

x
y

Methods

impl<T: Zero> Point2D<T>

fn zero() -> Point2D<T>

impl<T> Point2D<T>

fn new(x: T, y: T) -> Point2D<T>

impl<T: Mul<T, Output=T> + Add<T, Output=T> + Sub<T, Output=T> + Copy> Point2D<T>

fn dot(self, other: Point2D<T>) -> T

fn cross(self, other: Point2D<T>) -> T

impl<T: Copy + Add<T, Output=T>> Point2D<T>

fn add_size(&self, other: &Size2D<T>) -> Point2D<T>

impl<T: Float> Point2D<T>

fn min(self, other: Point2D<T>) -> Point2D<T>

fn max(self, other: Point2D<T>) -> Point2D<T>

impl<Unit, T0: NumCast + Clone> Point2D<Length<Unit, T0>>

fn cast<T1: NumCast + Clone>(&self) -> Option<Point2D<Length<Unit, T1>>>

Cast from one numeric representation to another, preserving the units.

impl<Unit, T: NumCast + Clone> Point2D<Length<Unit, T>>

fn as_f32(&self) -> Point2D<Length<Unit, f32>>

fn as_uint(&self) -> Point2D<Length<Unit, usize>>

Trait Implementations

impl<T: Debug> Debug for Point2D<T>

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

impl<T: Display> Display for Point2D<T>

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

impl<T: Clone + Add<T, Output=T>> Add for Point2D<T>

type Output = Point2D<T>

fn add(self, other: Point2D<T>) -> Point2D<T>

impl<T: Clone + Add<T, Output=T>> Add<Size2D<T>> for Point2D<T>

type Output = Point2D<T>

fn add(self, other: Size2D<T>) -> Point2D<T>

impl<T: Clone + Sub<T, Output=T>> Sub for Point2D<T>

type Output = Point2D<T>

fn sub(self, other: Point2D<T>) -> Point2D<T>

impl<T: Clone + Neg<Output=T>> Neg for Point2D<T>

type Output = Point2D<T>

fn neg(self) -> Point2D<T>

impl<Scale: Copy, T0: Mul<Scale, Output=T1>, T1: Clone> Mul<Scale> for Point2D<T0>

type Output = Point2D<T1>

fn mul(self, scale: Scale) -> Point2D<T1>

impl<Scale: Copy, T0: Div<Scale, Output=T1>, T1: Clone> Div<Scale> for Point2D<T0>

type Output = Point2D<T1>

fn div(self, scale: Scale) -> Point2D<T1>

Derived Implementations

impl<T: PartialEq> PartialEq for Point2D<T>

fn eq(&self, __arg_0: &Point2D<T>) -> bool

fn ne(&self, __arg_0: &Point2D<T>) -> bool

impl<T: Hash> Hash for Point2D<T>

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

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

impl<T: Eq> Eq for Point2D<T>

impl<T: Encodable> Encodable for Point2D<T>

fn encode<__ST: Encoder>(&self, __arg_0: &mut __ST) -> Result<(), __ST::Error>

impl<T: Decodable> Decodable for Point2D<T>

fn decode<__DT: Decoder>(__arg_0: &mut __DT) -> Result<Point2D<T>, __DT::Error>

impl<T: Copy> Copy for Point2D<T>

impl<T: Clone> Clone for Point2D<T>

fn clone(&self) -> Point2D<T>

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