Add conversion to rotation matrices

Let me know if this seems useful, and if you want any changes.