Struct sb_rust_library::math::Vector[][src]

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

A 2D vector over the reals.

Fields

x: f64y: f64

Implementations

impl Vector[src]

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

Creates a new point struct.

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

Computes the norm of this vector.

pub fn rotate_ccw(&self) -> Vector[src]

Computes the 90 degree counterclockwise rotation of this vector.

pub fn rotate_cw(&self) -> Vector[src]

Computes the 90 degree clockwise rotation of this vector.

Trait Implementations

impl Add<&'_ Vector> for Vector[src]

type Output = Vector

The resulting type after applying the + operator.

impl Add<&'_ Vector> for &Vector[src]

type Output = Vector

The resulting type after applying the + operator.

impl Add<&'_ Vector> for Point[src]

type Output = Point

The resulting type after applying the + operator.

impl Add<&'_ Vector> for &Point[src]

type Output = Point

The resulting type after applying the + operator.

impl Add<Vector> for Vector[src]

type Output = Vector

The resulting type after applying the + operator.

impl Add<Vector> for &Vector[src]

type Output = Vector

The resulting type after applying the + operator.

impl Add<Vector> for Point[src]

type Output = Point

The resulting type after applying the + operator.

impl Add<Vector> for &Point[src]

type Output = Point

The resulting type after applying the + operator.

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

impl AddAssign<&'_ Vector> for Point[src]

impl AddAssign<Vector> for Vector[src]

impl AddAssign<Vector> for Point[src]

impl Clone for Vector[src]

impl Copy for Vector[src]

impl Div<f64> for Vector[src]

type Output = Vector

The resulting type after applying the / operator.

impl Div<f64> for &Vector[src]

type Output = Vector

The resulting type after applying the / operator.

impl DivAssign<f64> for Vector[src]

impl From<(f64, f64)> for Vector[src]

impl From<Point> for Vector[src]

impl From<Vector> for Point[src]

impl Mul<&'_ Vector> for Vector[src]

type Output = f64

The resulting type after applying the * operator.

impl Mul<&'_ Vector> for &Vector[src]

type Output = f64

The resulting type after applying the * operator.

impl Mul<Vector> for Vector[src]

type Output = f64

The resulting type after applying the * operator.

impl Mul<Vector> for &Vector[src]

type Output = f64

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<f64> for &Vector[src]

type Output = Vector

The resulting type after applying the * operator.

impl MulAssign<f64> for Vector[src]

impl Neg for Vector[src]

type Output = Vector

The resulting type after applying the - operator.

impl Neg for &Vector[src]

type Output = Vector

The resulting type after applying the - operator.

impl Sub<&'_ Vector> for Vector[src]

type Output = Vector

The resulting type after applying the - operator.

impl Sub<&'_ Vector> for &Vector[src]

type Output = Vector

The resulting type after applying the - operator.

impl Sub<Vector> for Vector[src]

type Output = Vector

The resulting type after applying the - operator.

impl Sub<Vector> for &Vector[src]

type Output = Vector

The resulting type after applying the - operator.

impl SubAssign<&'_ Vector> for Vector[src]

impl SubAssign<Vector> for Vector[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

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

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

impl<T> Pointable for T

type Init = T

The type for initializers.

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.