[][src]Struct pixel_canvas::vector::Vec3

pub struct Vec3 {
    pub x: f32,
    pub y: f32,
    pub z: f32,
}

A 3-dimensional vector.

Fields

x: f32y: f32z: f32

Methods

impl Vec3[src]

pub fn xyz(x: f32, y: f32, z: f32) -> Self[src]

Construct a vector out of its components.

pub fn normal(self) -> Self[src]

Normalizes the vector (scales its length to 1).

pub fn dot(self, rhs: Vec3) -> f32[src]

Computes the dot product between two vectors.

pub fn cross(self, rhs: Vec3) -> Vec3[src]

Computes the cross product between two vectors.

pub fn len(&self) -> f32[src]

The length of a vector.

pub fn len2(&self) -> f32[src]

The squared length of a vector.

Trait Implementations

impl Clone for Vec3[src]

impl Copy for Vec3[src]

impl Add<Vec3> for Vec3[src]

type Output = Vec3

The resulting type after applying the + operator.

impl Sub<Vec3> for Vec3[src]

type Output = Vec3

The resulting type after applying the - operator.

impl Mul<f32> for Vec3[src]

type Output = Vec3

The resulting type after applying the * operator.

impl Div<f32> for Vec3[src]

type Output = Vec3

The resulting type after applying the / operator.

impl Debug for Vec3[src]

Auto Trait Implementations

impl Send for Vec3

impl Unpin for Vec3

impl Sync for Vec3

impl UnwindSafe for Vec3

impl RefUnwindSafe for Vec3

Blanket Implementations

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

type Owned = T

The resulting type after obtaining ownership.

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]

impl<T> Content for T where
    T: Copy
[src]

type Owned = T

A type that holds a sized version of the content.