func (quat *T) ToEulerAngles() (yHead, xPitch, zRoll float64) {
	z := quat.RotatedVec3(&vec3.T{0, 0, 1})
	yHead = math.Atan2(z[0], z[2])
	xPitch = -math.Atan2(z[1], math.Sqrt(z[0]*z[0]+z[2]*z[2]))
	quatNew := FromEulerAngles(yHead, xPitch, 0)
	x2 := quatNew.RotatedVec3(&vec3.T{1, 0, 0})
	x := quat.RotatedVec3(&vec3.T{1, 0, 0})
	r := vec3.Cross(&x, &x2)
	sin := vec3.Dot(&r, &z)
	cos := vec3.Dot(&x, &x2)
	zRoll = -math.Atan2(sin, cos)
	return
}
ToEulerAngles returns the euler angle(in radian) rotations of the quaternion.
package quaternion
import (
	"fmt"
	"math"
	"github.com/ungerik/go3d/float64/vec3"
	"github.com/ungerik/go3d/float64/vec4"
)
var (
	Zero = T{}
	Ident = T{0, 0, 0, 1}
)
type T [4]float64
func FromAxisAngle(axis *vec3.T, angle float64) T {
	angle *= 0.5
	sin := math.Sin(angle)
	q := T{axis[0] * sin, axis[1] * sin, axis[2] * sin, math.Cos(angle)}
	return q.Normalized()
}
func FromXAxisAngle(angle float64) T {
	angle *= 0.5
	return T{math.Sin(angle), 0, 0, math.Cos(angle)}
}
func FromYAxisAngle(angle float64) T {
	angle *= 0.5
	return T{0, math.Sin(angle), 0, math.Cos(angle)}
}
func FromZAxisAngle(angle float64) T {
	angle *= 0.5
	return T{0, 0, math.Sin(angle), math.Cos(angle)}
}
func FromEulerAngles(yHead, xPitch, zRoll float64) T {
	qy := FromYAxisAngle(yHead)
	qx := FromXAxisAngle(xPitch)
	qz := FromZAxisAngle(zRoll)
	return Mul3(&qy, &qx, &qz)
}