0

I'm developing an application where I show the user's movements on a map using GPS coordinates. Calculating the size of the movement between two location with loc1.distanceTo (loc2), where loc1 and 2 are of type Location. How can I calculate the angle (in degrees) of the movement?

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
Giammy
  • 83
  • 1
  • 7

1 Answers1

3

Did you do a search before you asked? This has been answered several times before. You can get the bearing (which I guess is what you mean by angle) through Location.bearingTo(). In your case it would be:

loc1.bearingTo(loc2)
britzl
  • 10,132
  • 7
  • 41
  • 38