[−][src]Struct axgeom::Vec2
A 2D vector.
Fields
x: N
y: 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.
fn div(self, rhs: S) -> Self
[src]
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.
fn add(self, rhs: Self) -> Self
[src]
impl<S: Sub<Output = S> + Copy> Sub<Vec2<S>> for Vec2<S>
[src]
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, rhs: Self) -> Self
[src]
impl<S: Mul<Output = S> + Copy> Mul<S> for Vec2<S>
[src]
type Output = Self
The resulting type after applying the *
operator.
fn mul(self, rhs: S) -> Self
[src]
impl<S: Neg<Output = S>> Neg for Vec2<S>
[src]
impl<S: AddAssign<S> + Copy> AddAssign<Vec2<S>> for Vec2<S>
[src]
fn add_assign(&mut self, rhs: Self)
[src]
impl<S: SubAssign<S> + Copy> SubAssign<Vec2<S>> for Vec2<S>
[src]
fn sub_assign(&mut self, rhs: Self)
[src]
impl<S: MulAssign<S> + Copy> MulAssign<S> for Vec2<S>
[src]
fn mul_assign(&mut self, scalar: S)
[src]
impl<S: DivAssign<S> + Copy> DivAssign<S> for Vec2<S>
[src]
fn div_assign(&mut self, scalar: S)
[src]
impl<N: Hash> Hash for Vec2<N>
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
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(&self) -> 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]
Auto Trait Implementations
impl<N> Unpin for Vec2<N> where
N: Unpin,
N: Unpin,
impl<N> Send for Vec2<N> where
N: Send,
N: Send,
impl<N> Sync for Vec2<N> where
N: Sync,
N: Sync,
impl<N> RefUnwindSafe for Vec2<N> where
N: RefUnwindSafe,
N: RefUnwindSafe,
impl<N> UnwindSafe for Vec2<N> where
N: UnwindSafe,
N: UnwindSafe,
Blanket Implementations
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.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,