[][src]Struct tge::math::Vector

pub struct Vector<N: Number = f32> {
    pub x: N,
    pub y: N,
}

Fields

x: Ny: N

Implementations

impl<N: Number> Vector<N>[src]

pub fn new(x: N, y: N) -> Self[src]

pub fn zero() -> Self[src]

pub fn none() -> Option<Self>[src]

impl Vector<f32>[src]

pub fn from_physical(
    physical_position: impl Into<PhysicalPosition>,
    scale_factor: f32
) -> Self
[src]

pub fn to_physical(&self, scale_factor: f32) -> PhysicalPosition[src]

impl Vector<i32>[src]

pub fn from_logical(
    logical_position: impl Into<LogicalPosition>,
    scale_factor: f32
) -> Self
[src]

pub fn to_logical(&self, scale_factor: f32) -> LogicalPosition[src]

Trait Implementations

impl<N: Number> Add<Vector<N>> for Vector<N>[src]

type Output = Self

The resulting type after applying the + operator.

impl<N: Number> AddAssign<Vector<N>> for Vector<N>[src]

impl<N: Clone + Number> Clone for Vector<N>[src]

impl<N: Copy + Number> Copy for Vector<N>[src]

impl<N: Debug + Number> Debug for Vector<N>[src]

impl<N: Number> Div<Vector<N>> for Size<N>[src]

type Output = Self

The resulting type after applying the / operator.

impl<N: Number> DivAssign<Vector<N>> for Size<N>[src]

impl<N: Number> From<(N, N)> for Vector<N>[src]

impl<N: Number> Into<(N, N)> for Vector<N>[src]

impl<N: Number> Mul<Vector<N>> for Size<N>[src]

type Output = Self

The resulting type after applying the * operator.

impl<N: Number> MulAssign<Vector<N>> for Size<N>[src]

impl<N: PartialEq + Number> PartialEq<Vector<N>> for Vector<N>[src]

impl<N: Number> StructuralPartialEq for Vector<N>[src]

impl<N: Number> Sub<Vector<N>> for Vector<N>[src]

type Output = Self

The resulting type after applying the - operator.

impl<N: Number> SubAssign<Vector<N>> for Vector<N>[src]

Auto Trait Implementations

impl<N> RefUnwindSafe for Vector<N> where
    N: RefUnwindSafe

impl<N> Send for Vector<N> where
    N: Send

impl<N> Sync for Vector<N> where
    N: Sync

impl<N> Unpin for Vector<N> where
    N: Unpin

impl<N> UnwindSafe for Vector<N> where
    N: UnwindSafe

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> From<T> for T[src]

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

impl<T> SetParameter for T

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

type Owned = T

The resulting type after obtaining ownership.

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.