Thank a lot for this, but
How did you avoid the crash when VECTOR.y is equal to 0 in the ANGLE.pan?