Rotation(double angle, Direction direction) { if (Accuracy.LengthIsZero(angle)) { angle = 0; direction = Direction.Zero; } h = Quaternion.Create(Math.Cos(angle / 2), direction.UnitVector * Math.Sin(angle / 2)); }
Rotation(Quaternion h) { this.h = h / h.Magnitude; }