Macro euler::dquat[][src]

macro_rules! dquat {
    () => { ... };
    ($expr:expr) => { ... };
    ($axis:expr; $angle:expr) => { ... };
    ($x:expr, $y:expr, $z:expr; $angle:expr) => { ... };
}

Double-precision quaternion macro constructor.

Identity.

let q = dquat!();
assert_eq!(q.as_ref(), &[0.0, 0.0, 0.0, 1.0]);

Rotation around explicit axis values.

use std::f64::consts::PI;
let q = dquat!(1.0, 0.0, 0.0; PI / 2.0);
assert_relative_eq!(q, DQuat::new(f64::cos(PI / 4.0), 0.0, 0.0, f64::sin(PI / 4.0)));

Rotation around a DVec3 axis.

use std::f64::consts::PI;
let axis = dvec3!(1.0, 0.0, 0.0);
let q = dquat!(axis; PI / 2.0);
assert_relative_eq!(q, DQuat::new(f64::cos(PI / 4.0), 0.0, 0.0, f64::sin(PI / 4.0)));