Questions tagged [bearing]

119 questions
127
votes
10 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 2 GPS points. I have researched on the haversine formula. Someone told me that I could also find the bearing using the same data. Edit Everything is working fine but the…
avitex
  • 2,124
  • 3
  • 18
  • 22
108
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,697
  • 9
  • 43
  • 60
63
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
  • 7,822
  • 4
  • 40
  • 42
21
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,447
  • 14
  • 72
  • 114
18
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
  • 956
  • 1
  • 8
  • 21
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…
Hannan
  • 1,653
  • 2
  • 20
  • 37
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
  • 97,987
  • 90
  • 271
  • 355
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
  • 654
  • 6
  • 20
8
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
  • 417
  • 1
  • 6
  • 16
7
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
  • 81
  • 1
  • 3
7
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
  • 335
  • 3
  • 15
6
votes
6 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
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
  • 61
  • 1
  • 2
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
  • 113
  • 1
  • 7
6
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,709
  • 8
  • 41
  • 63
1
2 3 4 5 6 7 8