eulerFromXYZ method
Set Quant using Euler equation
Implementation
Quaternion eulerFromXYZ(double x, double y, double z){
final c1 = math.cos( x * 0.5 );
final c2 = math.cos( y * 0.5 );
final c3 = math.cos( z * 0.5 );
final s1 = math.sin( x * 0.5 );
final s2 = math.sin( y * 0.5 );
final s3 = math.sin( z * 0.5 );
// XYZ
final _x = s1 * c2 * c3 + c1 * s2 * s3;
final _y = c1 * s2 * c3 - s1 * c2 * s3;
final _z = c1 * c2 * s3 + s1 * s2 * c3;
final _w = c1 * c2 * c3 - s1 * s2 * s3;
return Quaternion(_x, _y, _z, _w);
}