anchor.diff:  = quaternion
  -:author: 
  -:revnumber: 
  +:author:
  +:revnumber:
   :revdate: 2016/03/17 20:48
   :relfileprefix: ../
   :imagesdir: ..
  
positive.code: 
  === Rotation Matrix
  
  Commonly you might find yourself with a <<jme3/matrix#,Matrix>> defining a rotation. In fact, it's very common to contain a rotation in a <<jme3/matrix#,Matrix>> create a Quaternion, rotate the Quaternion, and then get the <<jme3/matrix#,Matrix>> back. Quaternion contains a `fromRotationMatrix` method that will create the appropriate Quaternion based on the give <<jme3/matrix#,Matrix>>. The `toRotationMatrix` will populate a given <<jme3/matrix#,Matrix>>.
  
  
  ==== Example - Rotate a Spatial Using a Rotation Matrix
  
negative.code: 
  == Quaternion
  
  See link:https://javadoc.jmonkeyengine.org/index.html?com/jme3/math/Quaternion.html[Javadoc]
  
  
  === Definition
  
  Quaternions define a subset of a hypercomplex number system. Quaternions are defined by (i^2^ = j^2^ = k^2^ = ijk = -1). jME makes use of Quaternions because they allow for compact representations of rotations, or correspondingly, orientations, in 3D space. With only four float values, we can represent an object's orientation, where a rotation matrix would require nine. They also require fewer arithmetic operations for concatenation.
  
  Additional benefits of the Quaternion is reducing the chance of link:http://en.wikipedia.org/wiki/Gimbal_lock[Gimbal Lock] and allowing for easily interpolation between two rotations (spherical linear interpolation or slerp).
  
  