[][src]Struct quicksilver::geom::Vector

pub struct Vector {
    pub x: f32,
    pub y: f32,
}

A 2D vector with an arbitrary numeric type

Fields

The x coordinate of the vector

The y coordinate of the vector

Methods

impl Vector
[src]

A vector with x = 0, y = 0

A vector with x = 1, y = 0

A vector with x = 0, y = 1

A vector with x = 1, y = 1

impl Vector
[src]

Create a new vector

Convert this vector into an nalgebra Vector2

Convert this vector into an nalgebra Point2

Create a unit vector at a given angle

Get the squared length of the vector (faster than getting the length)

Get the length of the vector

Clamp a vector somewhere between a minimum and a maximum

Get the cross product of a vector

Get the dot product of a vector

Normalize the vector's length from [0, 1]

Get only the X component of the Vector, represented as a vector

Get only the Y component of the Vector, represented as a vector

Get the vector equal to Vector(1 / x, 1 / y)

Multiply the components in the matching places

Get the angle a vector forms with the positive x-axis, counter clockwise

Create a vector with the same angle and the given length

Get the Euclidean distance to another vector

Get a vector with the minimum of each component of this and another vector

Get a vector with the maximum of each component of this and another vector

Trait Implementations

impl Shape for Vector
[src]

If any area bounded by the shape falls on the line

If any area is bounded by both the shape and the circle

If any area is bounded by both the shape and the rectangle

Create a copy of the shape that is contained within the bound

Create a copy of the shape with an offset center

impl Drawable for Vector
[src]

impl PartialEq<Vector> for Vector
[src]

This method tests for !=.

impl From<Matrix<f32, U2, U1, <DefaultAllocator as Allocator<f32, U2, U1>>::Buffer>> for Vector
[src]

impl From<Point<f32, U2>> for Vector
[src]

impl From<Vector> for LogicalPosition
[src]

impl From<Vector> for PhysicalPosition
[src]

impl From<LogicalPosition> for Vector
[src]

impl From<PhysicalPosition> for Vector
[src]

impl From<Vector> for LogicalSize
[src]

impl From<Vector> for PhysicalSize
[src]

impl From<LogicalSize> for Vector
[src]

impl From<PhysicalSize> for Vector
[src]

impl<T: Scalar, U: Scalar> From<(T, U)> for Vector
[src]

impl Clone for Vector
[src]

Performs copy-assignment from source. Read more

impl Copy for Vector
[src]

impl Eq for Vector
[src]

impl Default for Vector
[src]

impl Display for Vector
[src]

impl Debug for Vector
[src]

impl<T: Scalar> Div<T> for Vector
[src]

The resulting type after applying the / operator.

impl Add<Vector> for Vector
[src]

The resulting type after applying the + operator.

impl Sub<Vector> for Vector
[src]

The resulting type after applying the - operator.

impl<T: Scalar> Mul<T> for Vector
[src]

The resulting type after applying the * operator.

impl Mul<Vector> for Transform
[src]

Transform a vector

The resulting type after applying the * operator.

impl Neg for Vector
[src]

The resulting type after applying the - operator.

impl AddAssign<Vector> for Vector
[src]

impl SubAssign<Vector> for Vector
[src]

impl<T: Scalar> MulAssign<T> for Vector
[src]

impl<T: Scalar> DivAssign<T> for Vector
[src]

impl Distribution<Vector> for Standard
[src]

Create an iterator that generates random values of T, using rng as the source of randomness. Read more

impl Serialize for Vector
[src]

impl<'de> Deserialize<'de> for Vector
[src]

Auto Trait Implementations

impl Send for Vector

impl Sync for Vector

Blanket Implementations

impl<T> From for T
[src]

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

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

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

impl<T> SetParameter for T

Sets value as a parameter of self.

impl<T> Erased for T

impl<T> Scalar for T where
    T: Copy + PartialEq<T> + Any + Debug
[src]

Tests if Self the same as the type T Read more

impl<T, Right> ClosedMul for T where
    T: Mul<Right, Output = T> + MulAssign<Right>, 
[src]

impl<T, Right> ClosedAdd for T where
    T: Add<Right, Output = T> + AddAssign<Right>, 
[src]

impl<T> Same for T

Should always be Self

impl<T, Right> ClosedSub for T where
    T: Sub<Right, Output = T> + SubAssign<Right>, 
[src]

impl<T> ClosedNeg for T where
    T: Neg<Output = T>, 
[src]

impl<T, Right> ClosedDiv for T where
    T: Div<Right, Output = T> + DivAssign<Right>, 
[src]

impl<SS, SP> SupersetOf for SP where
    SS: SubsetOf<SP>, 
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]