>>Just varying either the x or y axis gives hugely different heading results (including at 'steep' angles Nan)
>>
>
>
>
> // Calculate compass heading
> var compassHeading = Math.atan(Vx / Vy);
>
>
>Have you tried replacing the Math.atan()) by the Math.atan2() ?
>
>
http://www.w3schools.com/jsref/jsref_atan2.aspHmm. Returns NaN (haven't dug into where that happens exactly)
Odd thing is it only runs once but no errors in the console.....