This concludes another week of working with scipy. This week was spent in implementing the conversion to and from rotation vectors. In addition, work was also started on initialization from Euler angles. Pretty standard stuff, but there’s always something to learn.

# Rotation Vectors

A rotation vector is a 3D vector whose direction gives the axis of rotation and whose norm gives the angle of rotation. Calculating the rotation quaternion from these two quantities is straightforward and is given by the formula here.

## Taylor Series

Even a simple formula needs to be implemented carefully. Were it not for my mentor, I would never have thought of using Taylor expansion for small numbers to avoid floating point inaccuracies.

# Euler Angles

This brings us to a much more controversial part of the module. This part required some discussion with regards to the API, the kind of rotations we decided to allow, and how best to implement the general cases.

The first task was to determine the kind of rotations that we supported.

## Extrinsic Rotations

In extrinsic rotations, the coordinate axes do not rotate with the body and remain fixed. In essence, these are rotations with respect to a global or ground frame of reference in physics.

## Intrinsic Rotations

In intrinsic rotations, the coordinate axes rotate with the body. These are rotations with respect to a body-centered frame of reference.

In theory any possible combination of intrinsic and extrinsic rotations is possible. In addition, there are few a definitions of Euler angles depending on the possible sequence of axes of rotation. It took some discussion to narrow down the range of possibilities and decide on the API that we would implement. After a few rounds of suggestions, initialization from euler is finally ready.

That’s it for this week I guess.