zmath.quaternion
A Quaternion it's used to store a space orientation / rotation, and makes easy to interpolate rotations, at same time that avoid grimbal locks that have using Euler angles
- 
  DeclarationaliasQua_f= Quaternion!float.Quaternion;Alias of a Quaternion with floats 
- 
  DeclarationaliasQua_d= Quaternion!double.Quaternion;Alias of a Quaternion with doubles 
- 
  DeclarationaliasQua_r= Quaternion!real.Quaternion;Alias of a Quaternion with reals 
- 
  DeclarationstructQuaternion(T = floatt) if (__traits(isFloating, T));Quaternionover a FloatPoint type,- 
  Declarationstatic enum size_tdim;Quaternion Dimension 
- 
  DeclarationTi;icomplex component
- 
  DeclarationTj;jcomplex component
- 
  DeclarationTk;kcomplex component
- 
  DeclarationTw;wreal component
- 
  DeclarationTx;alias of i component 
- 
  DeclarationTy;alias of j component 
- 
  DeclarationTz;alias of k component 
- 
  Declarationthis(in Ti, in Tj, in Tk, in Tw);Build a new Quaternion from a set of initial values ParametersTiiimaginary componentTjjimaginary componentTkkimaginary componentTwireal component
- 
  Declarationthis(in T[]xs);Build a new Quaternion from a array If no there values for j, and k, will be set to 0. w is set to 1 ParametersT[]xsArray with coords 
- 
  Declarationpure @nogc this(in Vector!(T, 3)vec);Build a new Quaternion from a 3D Vector w will be set to 1 ParametersVector!(T, 3)vecVector 3d 
- 
  Declarationpure @nogc this(in Vector!(T, 4)vec);Build a new Quaternion from a 4D Vector ParametersVector!(T, 4)vecVector 4d 
- 
  Declaration@nogc this(U)(Vector!(T, 3)v, Uangle) if (is(U : real));Creates a Quaternion from a 3d Vector and angleParametersVector!(T, 3)vRotation axis UangleRotation anglein radiansReturn ValueQuaternion that represents a rotation 
- 
  Declaration@nogc this(U)(Uroll, Upitch, Uyaw) if (__traits(isFloating, U));Creates a new Quaternion from Euler angles Params : roll= Rotation around X axis in radians (aka bank)pitch= Rotation around Y axis in radians (aka attitude)yaw= Rotation around Z axis in radians (aka heading)Return ValueQuaternion that represents a rotation 
- 
  Declarationconst pure @nogc TopIndex(size_ti);Returns icoord of this vector
- 
  Declaration@nogc voidopIndexAssign(Tc, size_ti);Assigns a value to a coord 
- 
  Declarationconst pure @nogc @property Tlength();Returns the actual lengthof this quaternion
- 
  Declarationconst pure @nogc @property Tsq_length();Returns the actual squared length of this quaternion 
- 
  Declarationconst pure @nogc boolopEquals()(auto ref const Quaternionrhs);Define Equality 
- 
  Declarationconst pure @nogc boolapproxEqual()(auto ref const Quaternionrhs, TmaxRelDiff= 0.01, TmaxAbsDiff= 1e-05);Approximated equality with controlable precision 
- 
  Declarationconst pure @nogc QuaternionopUnary(string op)() if (op == "+" || op == "-");Define unary operators + and - 
- 
  Declarationconst pure @nogc QuaternionopBinary(string op)(auto ref const Quaternionrhs) if (op == "+" || op == "-");Define binary operator + and - 
- 
  Declarationconst pure @nogc QuaternionopBinary(string op)(in Trhs) if (op == "*");Define Scalar multiplication 
- 
  Declarationconst pure @nogc QuaternionopBinary(string op)(auto ref const Quaternionrhs) if (op == "*");Defines Hamilton product for Quaternions ParametersQuaternionrhsQuaternion at rigth of operation Return: Quaternion result of hamilton product of this and rhs(thisrhs)
- 
  Declarationconst pure @nogc Quaternionconj();Obtain conjugate of a Quaternion 
- 
  Declarationconst pure @nogc @property boolisUnit();It's a unitary Quaternion (length == 1) 
- 
  Declarationpure @nogc voidnormalize();Normalize this Quaternion 
- 
  Declarationconst pure Vrotate(V)(auto ref const Vv) if (isVector!V && (V.dim >= 3));Apply a 3d rotation Quaternion over a 3d/4d Vector 
- 
  Declarationconst pure @nogc Vector!(T, 3)toAxisAngle(out Tangle);Calc the Axis and angleof rotation of this QuaternionParametersTangleSet to angleof rotationReturn ValueAxis of rotation vector 
- 
  Declarationconst pure @nogc Vector!(T, 3)toEuler();Returns a Vector with euler's angles Return ValueVector with Euler angles of rotation in radians TODO: Improve using code from here to avoid requiring pre-normalize the quaternion http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToEuler/ 
- 
  Declarationconst pure @nogc ToutopCast(Tout)() if (isQuaternion!Tout);Casting for convert between Quaternions 
- 
  Declarationconst pure @nogc ToutopCast(Tout)() if (isMatrix!Tout && (Tout.dim >= 3));Casting to rotation Matrix 
- 
  DeclarationstringtoString();Returns a string representation of this Quaternion 
 
- 
  
- 
  Declarationimmutable boolisQuaternion(T);Say if a thing it's a Quaternion