[][src]Struct block_breaker::Vector

pub struct Vector { /* fields omitted */ }

A 2D vector

Methods

impl Vector[src]

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

Create a new vector

pub fn x(&self) -> f64[src]

Get the x value

pub fn y(&self) -> f64[src]

Get the y value

pub fn dot(&self, other: &Vector) -> f64[src]

Perform the inner product with another vector

pub fn negate(&mut self)[src]

Negate the vector, negating each of the components

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

Get the length (magnitude) of the vector

pub fn normalise(&mut self)[src]

Normalise the vector

Trait Implementations

impl PartialEq<Vector> for Vector[src]

impl<'a, 'b> Add<&'b Vector> for &'a Position[src]

type Output = Position

The resulting type after applying the + operator.

impl Add<Vector> for Vector[src]

type Output = Self

The resulting type after applying the + operator.

impl<'a, 'b> Add<&'b Vector> for &'a Vector[src]

type Output = Vector

The resulting type after applying the + operator.

impl<'a, 'b> Add<&'b Position> for &'a Vector[src]

type Output = Position

The resulting type after applying the + operator.

impl Sub<Vector> for Vector[src]

type Output = Self

The resulting type after applying the - operator.

impl Mul<f64> for Vector[src]

type Output = Vector

The resulting type after applying the * operator.

impl Mul<Vector> for f64[src]

type Output = Vector

The resulting type after applying the * operator.

impl AddAssign<Vector> for Vector[src]

impl<'a> AddAssign<&'a Vector> for Vector[src]

impl SubAssign<Vector> for Vector[src]

impl Debug for Vector[src]

Auto Trait Implementations

impl Sync for Vector

impl Send for Vector

impl Unpin for Vector

impl RefUnwindSafe for Vector

impl UnwindSafe for Vector

Blanket Implementations

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

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

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.

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

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

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