Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Compass heading from deviceorientation
Message
De
24/04/2014 09:24:17
 
 
À
24/04/2014 09:06:36
Information générale
Forum:
HTML5
Catégorie:
Problèmes de navigateur
Divers
Thread ID:
01598938
Message ID:
01598962
Vues:
22
>>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.asp

Hmm. Returns NaN (haven't dug into where that happens exactly)
Odd thing is it only runs once but no errors in the console.....
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform