I don't know for the "algorithm", but you should use Atan2 instead of Atan. This will remove the division by zero problem.
Pitch, Yaw, and Roll
BlitzMax Forums/BlitzMax Programming/Pitch, Yaw, and RollThe forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.