[][src]Struct libosu::Point

pub struct Point<T>(pub T, pub T);

Represents a 2D point (or any pair of objects).

Implementations

impl<T: Copy + NumCast> Point<T>[src]

pub fn to_float<U: Float>(&self) -> Option<Point<U>>[src]

Converts this point to a floating point point

impl<T: Float> Point<T>[src]

pub fn distance(&self, other: Point<T>) -> T[src]

Calculates the Euclidean distance between 2 points.

pub fn magnitude(&self) -> T[src]

Calculates the magnitude of the vector.

pub fn norm(&self) -> Point<T>[src]

Calculates the norm of the vector.

Trait Implementations

impl<T: Add<Output = T>> Add<Point<T>> for Point<T>[src]

type Output = Point<T>

The resulting type after applying the + operator.

impl<T: Clone> Clone for Point<T>[src]

impl<T: Copy> Copy for Point<T>[src]

impl<T: Debug> Debug for Point<T>[src]

impl<T: Default> Default for Point<T>[src]

impl<'de, T> Deserialize<'de> for Point<T> where
    T: Deserialize<'de>, 
[src]

impl<T: Display> Display for Point<T>[src]

impl<T: Div<Output = T>> Div<Point<T>> for Point<T>[src]

type Output = Point<T>

The resulting type after applying the / operator.

impl<T: Clone + Div<Output = T>> Div<T> for Point<T>[src]

type Output = Point<T>

The resulting type after applying the / operator.

impl<T: PartialEq + Eq> Eq for Point<T>[src]

impl<T: Hash> Hash for Point<T>[src]

impl<T: Mul<Output = T>> Mul<Point<T>> for Point<T>[src]

type Output = Point<T>

The resulting type after applying the * operator.

impl<T: Clone + Mul<Output = T>> Mul<T> for Point<T>[src]

type Output = Point<T>

The resulting type after applying the * operator.

impl<T: PartialEq> PartialEq<Point<T>> for Point<T>[src]

impl<T> Serialize for Point<T> where
    T: Serialize
[src]

impl<T: Sub<Output = T>> Sub<Point<T>> for Point<T>[src]

type Output = Point<T>

The resulting type after applying the - operator.

Auto Trait Implementations

impl<T> RefUnwindSafe for Point<T> where
    T: RefUnwindSafe
[src]

impl<T> Send for Point<T> where
    T: Send
[src]

impl<T> Sync for Point<T> where
    T: Sync
[src]

impl<T> Unpin for Point<T> where
    T: Unpin
[src]

impl<T> UnwindSafe for Point<T> where
    T: UnwindSafe
[src]

Blanket Implementations

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

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

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

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

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

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

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[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.