Aug 22

A new fortran-90 library for 3D rotation conversions

This page describes a fortran-90 module, rotations3D.f90, that provides functions, both in single and double precision, to convert between seven different rotation parameterizations. 

Fortran-90 source code implementing the 3D rotation conversion functions is available for download (zip file containing the 3Drotations module, along with an example program and associated input file).  

3D rotations are frequently needed in a variety of numerical simulations.  We have created a fortran-90 module that implements seven different rotation parameterizations along with all the conversion routines between them, both in single and double precision.

The available parameterizations are:

  • Euler angles
  • rotation matrix
  • axis-angle pair
  • Rodrigues-Frank vector
  • quaternion
  • homochoric vector
  • cubochoric vector [see here for additional information]

The library provides 42 transformation functions between all parametrization pairs, as well as functions to compute both active and passive transformations of vector components.  This document, rotations-README, details the thought process behind the library, in particular the reasoning behind the any sign choices that have to be made when implementing rotations.