1

I have a coordinate and a heading, how do I get a second coordinate say 50 metres away from the first one in a C# function?

Example info:

Lat: 56.33908260  
Lon: 17.01194088

Radians:             -1.7453292519943295  
RadiansToDegrees:     57.295779513082323  
GeographicalDegrees: -170.0  
MathematicalDegrees: -100.00
Andrii Kalytiiuk
  • 1,501
  • 14
  • 26
mdc
  • 1,161
  • 6
  • 22
  • 37
  • Do you assume the world is a sphere (most models don't)? Do you measure the distance as a straight line, or along the surface? And in which direction should your new point be? There is a complete circle of such points. – CodesInChaos Aug 06 '12 at 10:59
  • Like the solution Markus Palme wrote below, maybe you have an even simpler function. Along the surface I guess and the direction I wrote in the example info. – mdc Aug 06 '12 at 12:23
  • I don't see any direction in your example. But I don't get your example in the first place. You still didn't state if you consider earth a sphere. – CodesInChaos Aug 06 '12 at 12:27
  • The last four lines is the direction in different formats. If it is a sphere according to WGS 84 then yes, else no. – mdc Aug 06 '12 at 12:53
  • WSG 84 is based on a reference ellipsoid which comes pretty close to the earth's actual shape. I would assume a sphere if accuracy is not that important (e.g. if the distances are rather small), if not use a more complex model like WSG 84. – Markus Palme Aug 07 '12 at 20:17

2 Answers2

2

It depends on the geodetic system you are using/want to use.

Geodetic systems or geodetic data are used [...] to translate positions indicated on their products to their real position on earth.

One of the most commonly used systems is WGS 84.

Some background: https://math.stackexchange.com/questions/720/how-to-calculate-a-heading-on-the-earths-surface

What you are looking for looks like the "Direct problem" to me. http://en.wikipedia.org/wiki/Vincenty's_formulae#Direct_Problem

Here you can find an implementation in C++ which should be rather easy to port (respect the licence):

https://github.com/pkohut/GeoFormulas/blob/master/GeoFormulas/VincentyDestination.cpp

This implementation is derived from this formula: http://www.movable-type.co.uk/scripts/latlong-vincenty-direct.html

Community
  • 1
  • 1
Markus Palme
  • 659
  • 4
  • 15
0

Not really a field I'm familiar with, but i'd look at how to calculate miles using latitude & longitude and turn that into a function.

Post some code of what you have tried, then we can take it from there?

EDIT : Possible answer

How do I find the lat/long that is x km north of a given lat/long

Community
  • 1
  • 1
Rohan Büchner
  • 5,333
  • 4
  • 62
  • 106