added attitude determination functions