News for hackers. Stuff that matters.
Re:Sin and Cos: The Programmer's Pals by 0xfaded on Tuesday March 06, 2018 @07:10PM (#16533311)
Until you need to differentiate a quaternion ...

Also, you don't pay the sin/cos costs when converting to a rotation matrix. For angle axis

  R = I + (sin x) * S + (1 - cos(x)) * S^2
Where S is the 3x3 skew symmetric matrix.

A unit quaternion representing a 3D rotation is sort of like angle axis

  q = cos(x/2), sin(x/2) <axis>
But

  sin(x)    = 2*cos(x/2)*sin(x/2)
  (1-cos(x) = 2*sin(x/2)*sin(x/2)
Where you pay the cost is in the construction of the quaternion.
Re:Sin and Cos: The Programmer's Pals by blt on Tuesday March 06, 2018 @08:19PM (#16533628)
What is the problem with differentiating a quaternion? E.g. the time derivative of the quaternion w.r.t. a fixed angular velocity is given here: https://fgiesen.wordpress.com/2012/08/24/quaternion-differen... .

I've more often encountered the need to integrate a quaternion, e.g. from inertial measurements or a rigid body physics model, but this is also a textbook lookup away.