orientation bug fix

atan2 misuse fixed