"Computing Euler angles from a rotation matrix" by Gregory G. Slabaugh
In Zemax - an optics simulation software - optical elements can be located by their local coordinate systems. This is very helpful if the components of an optical system are not placed in a straight line but dirstributed in xyz directions.
The following scripts uses a text file, which was exported by zemax and is structured like:
<optical_component_name>,<translation in x>,<translation in y>,<translation in z>,<rotation around x>,<rotation around y>,<rotation around z>
e.g. this could be the content of a simple system (see "zemax_csys-export.txt").