Questions tagged [bearing]

122 questions
155
votes
12 answers

Haversine formula in Python (bearing and distance between two GPS points)

Problem I would like to know how to get the distance and bearing between two GPS points. I have researched on the haversine distance. Someone told me that I could also find the bearing using the same data. Everything is working fine, but the…
avitex
  • 2,478
  • 3
  • 22
  • 22
109
votes
4 answers

Android phone orientation overview including compass

I've been trying to get my head around the Android orientation sensors for a while. I thought I understood it. Then I realised I didn't. Now I think (hope) I have a better feeling for it again but I am still not 100%. I will try and explain my…
Tim
  • 5,767
  • 9
  • 45
  • 60
73
votes
11 answers

Calculate compass bearing / heading to location in Android

I want to display an arrow at my location on a google map view that displays my direction relative to a destination location (instead of north). a) I have calculated north using the sensor values from the magnetometer and accelerometer. I know this…
Damian
  • 8,062
  • 4
  • 42
  • 43
23
votes
3 answers

Rotate marker as per user direction on Google Maps V2 Android

I want to rotate marker as per bearing or sensor value received from Accelerometer to show the user where actually he is moving. I have set marker icon and flat value to true but its not working as required. mCurrentLocationMarker.position(new…
Scorpion
  • 6,831
  • 16
  • 75
  • 123
19
votes
4 answers

Bearing from one coordinate to another

I implemented the "bearing" formula from http://www.movable-type.co.uk/scripts/latlong.html. But it seems highly inaccurate - I suspect some mistakes in my implementation. Could you help me with finding it? My code is below: protected static double…
Ivan T
  • 1,046
  • 1
  • 10
  • 22
17
votes
4 answers

GMap Bearing rotation in smooth motion (avoid jerky effect when changing bearing values)

I want to rotate GMap by changing the bearing angle value, so the camera rotates around the center point (360-Degree one full round ). When we change the bearing, there is a easing effect at camera start and end points. How can I control/change that…
Nah
  • 1,690
  • 2
  • 26
  • 46
11
votes
1 answer

How can I draw an Arrow showing the driving direction in MapView?

I use that Google Maps component MapView in an Android application. I can use the GPS location to show my location with a dot. But I would like to show an arrow instead, that points out the driving direction (bearing). I think that I can use the…
Jonas
  • 121,568
  • 97
  • 310
  • 388
10
votes
1 answer

Android Location getBearing() always returns 0

I've been trying to implement a feature for my Android app that gets the speed and direction of travel of the device, no matter where the device is pointed at. For example: If my Android device is pointed in the North direction and if I'm moving…
user3171597
  • 447
  • 1
  • 6
  • 17
10
votes
2 answers

Bearing of Current location in iOS SDK

I have just completed an Android app, where I used bearing value of current location. Now I am trying to do same app for iOS. But did not find a way to get bearing of current location in iOS sdk? I am not looking how to calculate bearing between two…
arefin
  • 365
  • 3
  • 17
9
votes
2 answers

Calculate bearing between 2 points with javascript

I want to calculate the bearing from point 1 to point 2 The input format is 52.070564 - 4.407116 No matter what i try i cannot get an correct output. The formula i use is : // koers berekenen var y = Math.sin(ln-ln1) * Math.cos(lt); var x =…
Rogier
  • 101
  • 1
  • 2
  • 3
8
votes
2 answers

Vehicle movement using bearing

Currently working on vehicle tracking App where I will have to show the movement of the car on the polyline which is set from current location to destination and on the movement of the car I will have have to erase the coordinates like Uber/Ola. I…
androholic
  • 686
  • 6
  • 23
7
votes
3 answers

How to find the average of a set of bearings

Possible Duplicate: How do you calculate the average of a set of angles? If I have a set of bearings, ranging from 1-360, how can I find the average? Usually to find the average one would add them all up and divide by the number of items. The…
Kenny
  • 71
  • 1
  • 2
7
votes
1 answer

FInd latitude longitude point in php given initial lat lng, distance, and bearing

In php, given a latitude and longitude point, a bearing (in degrees), and a distance (in feet or km or whatever) how do I figure out what the new lat lng point is? here is what I tried, but it's wrong. function destinationPoint($lat, $lng, $brng,…
user379468
  • 3,989
  • 10
  • 50
  • 68
6
votes
7 answers

Calculating coordinates given a bearing and a distance

I am having problems implementing the function described here here. This is my Java implementation: private static double[] pointRadialDistance(double lat1, double lon1, double radianBearing, double radialDistance) { double lat =…
user106996
  • 191
  • 2
  • 2
  • 5
6
votes
1 answer

In Android, is there a way to display the bearing/heading indicator on google maps

Is there a way to to enable this on my map? All the posts that I have searched explain only how to calculate the bearing... Doesn't Google Maps API include that? thanks!
Ghost
  • 133
  • 1
  • 8
1
2 3
8 9