added getDirectionAngle() function