M Vignesh
M Vignesh

Reputation: 1646

How to find the user moving direction using the bearing value returned by location manager?

LocationObject.getBearing() returns the horizontal direction of travel of this device[0 to 360 degree].

How to calculate the user moving direction like North, south and all from this bearing value?

Thanks in advance.

Upvotes: 0

Views: 1428

Answers (1)

shkschneider
shkschneider

Reputation: 18243

From the documentation:

Returns the direction of travel in degrees East of true North. If hasBearing() is false, 0.0 is returned.

  • So 0 is north (and the degrees goes clockwise)
  • So 90 would be East
  • 180 South
  • 270 West

Upvotes: 4

Related Questions