calculate location in virtual radar by gps position and compass
so i got three variables, my location, my target location and the compass heading. how can i calculate where the target location should be represented on a virtual radar?
i guess i first must calculate the distance between the two gps points and the angle of them relative to north or so. and then there should be a formula with sin or co开发者_Go百科s to place that point on a coordinate system...?
ps: in javascript...
Start with simpler problems.
- In 2D, try converting back and forth between cartesian and polar coordinates. References are available.
- Do the same, but for the polar coordinates use an observer who measures angles from some ray that is not in the X direction.
- The same, but using an origin for the polar coordinates that is not at {x=0,y=0}.
- In 3D, go back and forth between cartesian and spherical coordinates.
- Again, with spherical coordinates in an arbitrary orientation, using an arbitrary origin.
- Now convert from GPS coordinates (which are spherical) to cartesian, then to radar-centered spherical.
精彩评论