Trait gfxmath_vec3::ops::Cross[][src]

pub trait Cross<Rhs = Self> {
    type Output;
    fn cross(self, rhs: Rhs) -> Self::Output;
}

Perform the cross product of vectors

Associated Types

Loading content...

Required methods

fn cross(self, rhs: Rhs) -> Self::Output[src]

Loading content...

Implementors

impl<T> Cross<&'_ Vec3<T>> for &Vec3<T> where
    T: Add<Output = T> + Mul<Output = T> + Sub<Output = T> + Copy
[src]

type Output = Vec3<T>

impl<T> Cross<&'_ Vec3<T>> for Vec3<T> where
    T: Add<Output = T> + Mul<Output = T> + Sub<Output = T> + Copy
[src]

type Output = Vec3<T>

impl<T> Cross<Vec3<T>> for &Vec3<T> where
    T: Add<Output = T> + Mul<Output = T> + Sub<Output = T> + Copy
[src]

type Output = Vec3<T>

impl<T> Cross<Vec3<T>> for Vec3<T> where
    T: Add<Output = T> + Mul<Output = T> + Sub<Output = T> + Copy
[src]

type Output = Vec3<T>

fn cross(self, rhs: Vec3<T>) -> Self::Output[src]

use gfxmath_vec3::ops::Cross;
use gfxmath_vec3::Vec3;

let a = Vec3::new(1.0, 3.0, 2.5);
let b = Vec3::all(2.0);

let res = a.cross(b);
 
assert_eq!(1.0, res.x);
assert_eq!(3.0, res.y);
assert_eq!(-4.0, res.z);
Loading content...