Vector3

Type Alias Vector3 

Source
pub type Vector3<T> = [T; 3];
Expand description

Three dimensional vector (Pure Quaternion)

The type [q1, q2, q3] is equivalent to the expression q1i + q2j + q3k, where i, j, k are basis of quaternions and satisfy the following equality:

i^2 = j^2 = k^2 = ijk = -1

Trait Implementations§

Source§

impl<T: Float> QuaternionOps<T> for Vector3<T>

Source§

fn sum(self) -> T

Source§

fn add(self, rhs: Vector3<T>) -> Vector3<T>

self + rhs
Source§

fn sub(self, rhs: Vector3<T>) -> Vector3<T>

self - rhs
Source§

fn scale(self, s: T) -> Vector3<T>

s * self
Source§

fn scale_add(self, s: T, b: Vector3<T>) -> Vector3<T>

s * self + b
Source§

fn hadamard(self, rhs: Vector3<T>) -> Vector3<T>

self ∘ rhs
Source§

fn hadamard_add(self, b: Vector3<T>, c: Vector3<T>) -> Vector3<T>

self ∘ b + c
Source§

fn dot(self, b: Vector3<T>) -> T

Source§

fn norm(self) -> T

Source§

fn negate(self) -> Vector3<T>

-self
Source§

fn mul(self, rhs: Vector3<T>) -> Quaternion<T>

self * rhs
Source§

fn inv(self) -> Vector3<T>

Source§

fn exp(self) -> Quaternion<T>