[−][src]Struct tray_rust::linalg::vector::Vector
Vector is a standard 3 component vector
Fields
x: f32
y: f32
z: f32
Methods
impl Vector
[src]
pub fn new(x: f32, y: f32, z: f32) -> Vector
[src]
Initialize the vector and set values for x, y, z
pub fn broadcast(x: f32) -> Vector
[src]
Initialize the vector with the same value of x, y, z
pub fn length_sqr(&self) -> f32
[src]
Compute the squared length of the vector
pub fn length(&self) -> f32
[src]
Compute the length of the vector
pub fn normalized(&self) -> Vector
[src]
Get a normalized copy of this vector
Trait Implementations
impl Clone for Vector
[src]
impl Copy for Vector
[src]
impl PartialEq<Vector> for Vector
[src]
impl PartialOrd<Vector> for Vector
[src]
fn partial_cmp(&self, other: &Vector) -> Option<Ordering>
[src]
fn lt(&self, other: &Vector) -> bool
[src]
fn le(&self, other: &Vector) -> bool
[src]
fn gt(&self, other: &Vector) -> bool
[src]
fn ge(&self, other: &Vector) -> bool
[src]
impl Debug for Vector
[src]
impl Div<Vector> for Vector
[src]
type Output = Vector
The resulting type after applying the /
operator.
fn div(self, rhs: Vector) -> Vector
[src]
Divide the vectors components by the right hand side's components
impl Div<f32> for Vector
[src]
type Output = Vector
The resulting type after applying the /
operator.
fn div(self, rhs: f32) -> Vector
[src]
Divide the vectors components by a scalar
impl Sub<Vector> for Vector
[src]
type Output = Vector
The resulting type after applying the -
operator.
fn sub(self, rhs: Vector) -> Vector
[src]
Subtract two vectors
impl Sub<Vector> for Point
[src]
type Output = Point
The resulting type after applying the -
operator.
fn sub(self, rhs: Vector) -> Point
[src]
Subtract a vector from a point, translating the point by -vector
impl Add<Vector> for Vector
[src]
type Output = Vector
The resulting type after applying the +
operator.
fn add(self, rhs: Vector) -> Vector
[src]
Add two vectors together
impl Add<Vector> for Point
[src]
type Output = Point
The resulting type after applying the +
operator.
fn add(self, rhs: Vector) -> Point
[src]
Add two points together
impl Mul<Vector> for Vector
[src]
type Output = Vector
The resulting type after applying the *
operator.
fn mul(self, rhs: Vector) -> Vector
[src]
Multiply two vectors
impl Mul<f32> for Vector
[src]
type Output = Vector
The resulting type after applying the *
operator.
fn mul(self, rhs: f32) -> Vector
[src]
Scale the vector by some value
impl Mul<Vector> for f32
[src]
type Output = Vector
The resulting type after applying the *
operator.
fn mul(self, rhs: Vector) -> Vector
[src]
Scale the vector by some value
impl Mul<Point> for Vector
[src]
type Output = Point
The resulting type after applying the *
operator.
fn mul(self, rhs: Point) -> Point
[src]
Scale the vector by some value
impl Mul<Vector> for Point
[src]
type Output = Point
The resulting type after applying the *
operator.
fn mul(self, rhs: Vector) -> Point
[src]
Scale the vector by some value
impl Mul<Vector> for Transform
[src]
type Output = Vector
The resulting type after applying the *
operator.
fn mul(self, v: Vector) -> Vector
[src]
Multiply the vector by the transform to apply the transformation
impl Neg for Vector
[src]
type Output = Vector
The resulting type after applying the -
operator.
fn neg(self) -> Vector
[src]
Negate the vector
impl Index<usize> for Vector
[src]
type Output = f32
The returned type after indexing.
fn index(&self, i: usize) -> &f32
[src]
Access the vector by index
- 0 = x
- 1 = y
- 2 = z
impl IndexMut<usize> for Vector
[src]
impl StructuralPartialEq for Vector
[src]
Auto Trait Implementations
impl Send for Vector
impl Sync for Vector
impl Unpin for Vector
impl UnwindSafe for Vector
impl RefUnwindSafe for Vector
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Interpolate for T where
T: Add<T, Output = T> + Mul<f32, Output = T> + Copy,
[src]
T: Add<T, Output = T> + Mul<f32, Output = T> + Copy,