public Quaternion(EulerAngle e) { double c1 = Math.Cos(e.Yaw * 0.5d); double c2 = Math.Cos(e.Pitch * 0.5d); double c3 = Math.Cos(e.Roll * 0.5d); double s1 = Math.Sin(e.Yaw * 0.5d); double s2 = Math.Sin(e.Pitch * 0.5d); double s3 = Math.Sin(e.Roll * 0.5d); W = c1 * c2 * c3 - s1 * s2 * s3; X = s1 * s2 * c3 + c1 * c2 * s3; Y = s1 * c2 * c3 + c1 * s2 * s3; Z = c1 * s2 * c3 - s1 * c2 * s3; }
public Matrix(EulerAngle euler) : this(new Quaternion(euler)) { }