[][src]Struct arcs::Vector

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

Your typical 2D vector.

Fields

x: f64y: f64

Methods

impl Vector[src]

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

Create a new Vector.

Panics

This will panic if x or y aren't finite.

pub const fn new_unchecked(x: f64, y: f64) -> Self[src]

pub fn from_r_theta(radius: f64, angle: f64) -> Self[src]

pub const fn zero() -> Vector[src]

pub const fn x_axis() -> Vector[src]

pub const fn y_axis() -> Vector[src]

pub fn length(self) -> f64[src]

pub fn angle(self) -> f64[src]

pub fn unit_vector(self) -> Vector[src]

pub fn orientation(first: Vector, second: Vector, third: Vector) -> Orientation[src]

pub fn dot(left: Vector, right: Vector) -> f64[src]

pub fn cross(left: Vector, right: Vector) -> f64[src]

pub fn lerp(start: Vector, end: Vector, progress: f64) -> Vector[src]

pub fn centre_of_three_points(
    first: Vector,
    second: Vector,
    third: Vector
) -> Option<Vector>
[src]

pub fn rotated(self, angle: f64) -> Vector[src]

Trait Implementations

impl Add<Vector> for Vector[src]

type Output = Vector

The resulting type after applying the + operator.

impl AddAssign<Vector> for Vector[src]

impl Bounded for Vector[src]

impl Clone for Vector[src]

impl ClosestPoint for Vector[src]

impl Copy for Vector[src]

impl Debug for Vector[src]

impl Div<f64> for Vector[src]

type Output = Vector

The resulting type after applying the / operator.

impl DivAssign<f64> for Vector[src]

impl From<Vector> for Vec2[src]

impl FromIterator<Vector> for Closest[src]

impl Length for Vector[src]

fn length(&self) -> f64[src]

Calculates the Vector's magnitude.

let vector = Vector::new(3.0, 4.0);

assert_eq!(vector.length(), 5.0);

impl Mul<Vector> for f64[src]

type Output = Vector

The resulting type after applying the * operator.

impl Mul<Vector> for Affine[src]

type Output = Vector

The resulting type after applying the * operator.

impl Mul<f64> for Vector[src]

type Output = Vector

The resulting type after applying the * operator.

impl MulAssign<Affine> for Vector[src]

impl MulAssign<f64> for Vector[src]

impl PartialEq<Vector> for Vector[src]

impl Scale for Vector[src]

impl StructuralPartialEq for Vector[src]

impl Sub<Vector> for Vector[src]

type Output = Vector

The resulting type after applying the - operator.

impl SubAssign<Vector> for Vector[src]

impl Translate 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]

impl<T> Any for T where
    T: Any

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

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

impl<T> Event for T where
    T: Send + Sync + 'static, 

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

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

impl<T> Resource for T where
    T: Any + Send + Sync
[src]

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

impl<T, U> RoundInto<U> for T where
    U: RoundFrom<T>, 
[src]

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.