[−][src]Struct libosu::Point
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.
pub fn add(self, other: Point<T>) -> Self::Output
[src]
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]
T: Deserialize<'de>,
pub fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
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.
pub fn div(self, other: Point<T>) -> Self::Output
[src]
impl<T: Clone + Div<Output = T>> Div<T> for Point<T>
[src]
type Output = Point<T>
The resulting type after applying the /
operator.
pub fn div(self, other: T) -> Self::Output
[src]
impl<T: PartialEq + Eq> Eq for Point<T>
[src]
impl<T: Hash> Hash for Point<T>
[src]
pub fn hash<H>(&self, h: &mut H) where
H: Hasher,
[src]
H: Hasher,
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<T: Mul<Output = T>> Mul<Point<T>> for Point<T>
[src]
type Output = Point<T>
The resulting type after applying the *
operator.
pub fn mul(self, other: Point<T>) -> Self::Output
[src]
impl<T: Clone + Mul<Output = T>> Mul<T> for Point<T>
[src]
type Output = Point<T>
The resulting type after applying the *
operator.
pub fn mul(self, other: T) -> Self::Output
[src]
impl<T: PartialEq> PartialEq<Point<T>> for Point<T>
[src]
pub fn eq(&self, other: &Point<T>) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<T> Serialize for Point<T> where
T: Serialize,
[src]
T: Serialize,
pub fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<T: Sub<Output = T>> Sub<Point<T>> for Point<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for Point<T> where
T: RefUnwindSafe,
[src]
T: RefUnwindSafe,
impl<T> Send for Point<T> where
T: Send,
[src]
T: Send,
impl<T> Sync for Point<T> where
T: Sync,
[src]
T: Sync,
impl<T> Unpin for Point<T> where
T: Unpin,
[src]
T: Unpin,
impl<T> UnwindSafe for Point<T> where
T: UnwindSafe,
[src]
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,