geolocation - GPS: How do I get correct angle to display arrow facing to target -


im working javascript , geolocation module in html5. works fine, come point don't know how handle it. might easy don't point. display arrow thats shows me direction target location. got information geolocation module , found fine , correct bearing calculation here: arrow pointing gps position not pointing in right direction in javascript

my concrete problem described in example: lets facing north while target straight in south, behind me. walk north, while bearing tells me: 180 degrees (to target in south), correct & fine… bearing arrow on cellar phone points through me, target location, fine. turn 180 degrees, facing target location , approaching it. bearing, of course, still says 180 degrees, correct. move towards target location, arrow on cellar phone should turn 180 point target location. of course can't because bearing still says: 180 degrees. assume somehow have combine heading angle bearing angle, arrow points correct target location. has idea? hint appreciated.

erm, guess got it, it's difference of both angles:

var localangle = bearing - position.coords.heading; if (localangle < 0) {localangle += 360;};

bearing location want go , localangle 1 heading to.

my first test showed kinda correct results localangle jumped quite lot. nevertheless guess be...


Comments

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -