Trait gfxmath_vec3::ops::Dot[][src]

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

Perform the dot product of vectors

Associated Types

Loading content...

Required methods

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

Loading content...

Implementors

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

type Output = T

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

type Output = T

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

type Output = T

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

type Output = T

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

use gfxmath_vec3::{Vec3, ops::Dot};
 
let a = Vec3::new(3.0, 4.0, 5.0);
let b = Vec3::new(2.0, 1.0, 3.0);
 
let res = a.dot(b);
 
assert_eq!(25.0, res);
Loading content...