[−][src]Struct zeno::Vector
Two dimensional vector.
Fields
x: f32
y: f32
Implementations
impl Vector
[src]
pub const ZERO: Self
[src]
Vector with both components set to zero.
pub const fn new(x: f32, y: f32) -> Self
[src]
Creates a new vector with the specified coordinates.
pub fn length(self) -> f32
[src]
Returns the length of the vector.
pub fn length_squared(self) -> f32
[src]
Returns the squared length of the vector.
pub fn distance_to(self, other: Self) -> f32
[src]
Returns the distance between two points.
pub fn dot(self, other: Self) -> f32
[src]
Computes the dot product of two vectors.
pub fn cross(self, other: Self) -> f32
[src]
Computes the cross product of two vectors.
pub fn normalize(self) -> Self
[src]
Returns a normalized copy of the vector.
pub fn ceil(self) -> Self
[src]
Returns a new vector containing the smallest integer values greater than or equal to each component.
pub fn floor(self) -> Self
[src]
Returns a new vector containing the largest integer values less than or equal to each component.
pub fn angle_to(self, other: Self) -> Angle
[src]
Returns the angle to the specified vector.
pub fn nearly_eq(self, other: Vector) -> bool
[src]
Returns true if this vector is approximately equal to other using a standard single precision epsilon value.
pub fn nearly_eq_by(self, other: Vector, epsilon: f32) -> bool
[src]
Returns true if this vector is approximately equal to other using the specified epsilon value.
Trait Implementations
impl Add<Vector> for Vector
[src]
type Output = Self
The resulting type after applying the +
operator.
fn add(self, rhs: Self) -> Self
[src]
impl Clone for Vector
[src]
impl Copy for Vector
[src]
impl Debug for Vector
[src]
impl Default for Vector
[src]
impl Div<Vector> for Vector
[src]
type Output = Self
The resulting type after applying the /
operator.
fn div(self, rhs: Self) -> Self
[src]
impl Div<f32> for Vector
[src]
type Output = Self
The resulting type after applying the /
operator.
fn div(self, rhs: f32) -> Self
[src]
impl From<[f32; 2]> for Vector
[src]
impl From<[i32; 2]> for Vector
[src]
impl From<(f32, f32)> for Vector
[src]
impl From<(f32, i32)> for Vector
[src]
impl From<(i32, f32)> for Vector
[src]
impl From<(i32, i32)> for Vector
[src]
impl From<Vector> for [f32; 2]
[src]
impl From<Vector> for (f32, f32)
[src]
impl From<f32> for Vector
[src]
impl From<i32> for Vector
[src]
impl Mul<Vector> for Vector
[src]
type Output = Self
The resulting type after applying the *
operator.
fn mul(self, rhs: Self) -> Self
[src]
impl Mul<f32> for Vector
[src]
type Output = Self
The resulting type after applying the *
operator.
fn mul(self, rhs: f32) -> Self
[src]
impl PartialEq<Vector> for Vector
[src]
impl StructuralPartialEq for Vector
[src]
impl Sub<Vector> for Vector
[src]
Auto Trait Implementations
impl RefUnwindSafe for Vector
impl Send for Vector
impl Sync for Vector
impl Unpin for Vector
impl UnwindSafe for Vector
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,
fn borrow_mut(&mut self) -> &mut T
[src]
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.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,