[][src]Struct axgeom::Vec2

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

A 2D vector.

Fields

x: Ny: N

Methods

impl<S: Mul<Output = S> + Add<Output = S> + Copy> Vec2<S>[src]

pub fn magnitude2(&self) -> S[src]

pub fn dot(&self, other: Vec2<S>) -> S[src]

impl<S: Float> Vec2<S>[src]

pub fn normalize_to(&self, mag: S) -> Vec2<S>[src]

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

impl<B: Copy> Vec2<B>[src]

pub fn inner_as<A: PrimitiveFrom<B>>(&self) -> Vec2<A>[src]

impl<B> Vec2<B>[src]

pub fn get_axis(&self, axis: impl AxisTrait) -> &B[src]

Get the range of one axis.

pub fn get_axis_mut(&mut self, axis: impl AxisTrait) -> &mut B[src]

Get the mutable range of one axis.

pub fn inner_into<A: From<B>>(self) -> Vec2<A>[src]

pub fn inner_try_into<A: TryFrom<B>>(self) -> Result<Vec2<A>, A::Error>[src]

Trait Implementations

impl<N: Debug> Debug for Vec2<N>[src]

impl<S: Div<Output = S> + Copy> Div<S> for Vec2<S>[src]

type Output = Self

The resulting type after applying the / operator.

impl<N: PartialEq> PartialEq<Vec2<N>> for Vec2<N>[src]

impl<N: Eq> Eq for Vec2<N>[src]

impl<S: Add<Output = S> + Copy> Add<Vec2<S>> for Vec2<S>[src]

type Output = Self

The resulting type after applying the + operator.

impl<S: Sub<Output = S> + Copy> Sub<Vec2<S>> for Vec2<S>[src]

type Output = Self

The resulting type after applying the - operator.

impl<S: Mul<Output = S> + Copy> Mul<S> for Vec2<S>[src]

type Output = Self

The resulting type after applying the * operator.

impl<S: Neg<Output = S>> Neg for Vec2<S>[src]

type Output = Vec2<S>

The resulting type after applying the - operator.

impl<S: AddAssign<S> + Copy> AddAssign<Vec2<S>> for Vec2<S>[src]

impl<S: SubAssign<S> + Copy> SubAssign<Vec2<S>> for Vec2<S>[src]

impl<S: MulAssign<S> + Copy> MulAssign<S> for Vec2<S>[src]

impl<S: DivAssign<S> + Copy> DivAssign<S> for Vec2<S>[src]

impl<N: Hash> Hash for Vec2<N>[src]

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

Feeds a slice of this type into the given [Hasher]. Read more

impl<N: Copy> Copy for Vec2<N>[src]

impl<N: Float> AsRef<Vec2<N>> for Vec2<NotNan<N>>[src]

impl<N: Float> AsMut<Vec2<N>> for Vec2<NotNan<N>>[src]

impl<N: Clone> Clone for Vec2<N>[src]

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

Performs copy-assignment from source. Read more

impl<S: Zero + Eq + Copy> Zero for Vec2<S>[src]

fn set_zero(&mut self)[src]

Sets self to the additive identity element of Self, 0.

Auto Trait Implementations

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

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

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

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

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

Blanket Implementations

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> Into<U> for T where
    U: From<T>, 
[src]

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

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.

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

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

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

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

type Owned = T

The resulting type after obtaining ownership.