Just a random query - I have been told that using quaternionic math is very good for dealing with orientation, position, rotation and rotational orientation. Are you using them in your 'roid mathematics? If not, it might help.
My favorite way to do it has always been to just use an x,y,z grid...