in reply to
Polar Co-Ordinates: Rotating a 3D cartesian point around a fixed axis?
Is your data PDB? It certainly looks like it (always useful to call things what they are). Perhaps Ivan Tubert-Brohman's Chemistry stuff on CPAN is useful: Chemistry::File::PDB.
I'm also wondering whether existing GIS software (postgis for postgresql comes to mind, or even plain vanilla postgresql geometric datatypes) might not already contain what you need, although admittedly it's probably a bit of a learning curve.