Learn the fundamentals of the popular programming language JavaScript so that you can explore the realm of web development.

Hi,

Could anyone suggest a formula / method for updating eastings and northings using a distance and a bearing?

Could anyone suggest a formula / method for updating eastings and northings using a distance and a bearing?

Experts Exchange Solution brought to you by

Enjoy your complimentary solution view.

Get every solution instantly with Premium.
Start your 7-day free trial.

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

The following page is one I've gotten a lot of information from. To project a point a given distance & bearing from a given coordinate, you could use the equations to determine destination using Rhumb lines.

Erm, forgot to add the link:

http://www.movable-type.co.uk/scripts/latlong.html

http://www.movable-type.co.uk/scripts/latlong.html

The data is on OSGB70 projection, it would be sitting within a variety of GIS applications. Ideally i would like to be able to export it to a xls, csv or dxf then specify a bearing and a distance to update specific points.

Many Thanks

OSGB70 & ODGB36 share the same ellipsoid:

OSGB70: http://www.eye4software.com/products/coordinatecalculator/datum/175/

OSGB36: http://www.eye4software.com/products/coordinatecalculator/datum/12/

This page gives you some idea of how to do the transformation:

http://www.linz.govt.nz/geodetic/conversion-coordinates/geodetic-datum-conversion/datum-transformation-equations/index.aspx

The nice thing is that as the transformation and rotation parameters are all zero (for WGS84 & OSGB70), you only have to convert your coordinates in OSGB70 to Cartesian (using the Airy ellipsoid), and then straight back to WGS84 coordinates (using the WGS84 ellipsoid).

Actually, I'm guessing that your data is already cartesian coordinates as you mentioned Eastings & Northings, so you should only have to use the ToWGS84 method.

Then operating on the WGS84 using the equations in the 1st set of links I posted.

```
private static void FromOSGB70(double lat, double lon, double h,
out double x, out double y, out double z) {
// WGS coordinates in radians
double phi = lat * Math.PI / 180;
double lambda = lon * Math.PI / 180;
// Airy 1830 ellipsoid parameters
// http://www.eye4software.com/products/coordinatecalculator/datum/175/
// Semi-major axis
double a = 6377563.396;
// Flattening
double f = 1 / 299.3249646;
// Eccentricity squared
double e2 = (2 * f) - (f * f);
double nu = a / Math.Sqrt(1 - e2 * Math.Pow(Math.Sin(phi), 2));
x = (nu + h) * Math.Cos(phi) * Math.Cos(lambda);
y = (nu + h) * Math.Cos(phi) * Math.Sin(lambda);
z = ((nu * (1 - e2)) + h) * Math.Sin(phi);
}
private static void ToWGS84(double x, double y, double z,
out double lat, out double lon, out double h) {
// WGS84 ellipsoid parameters
// http://www.eye4software.com/products/coordinatecalculator/datum/7/
// Semi-major axis
double a = 6378137;
// Flattening
double f = 1 / 298.257223563;
// Eccentricity squared
double e2 = (2 * f) - (f * f);
double p = Math.Sqrt((x * x) + (y * y));
double r = Math.Sqrt((p * p) + (z * z));
double mu = Math.Atan2(
z * ((1 - f) + (e2 * a / r)),
p
);
double lambda= Math.Atan2(y, x);
double phi = Math.Atan2(
(z * (1 - f)) + (e2 * a * Math.Pow(Math.Sin(mu), 3)),
(1 - f) * (p - (e2 * a * Math.Pow(Math.Cos(mu), 3)))
);
h = (p * Math.Cos(phi)) + (z * Math.Sin(phi)) -
(a * Math.Sqrt(1 - (e2 * Math.Pow(Math.Sin(phi), 2))));
lat = phi * 180 / Math.PI;
lon = lambda * 180 / Math.PI;
}
```

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
GIS/GPS Programming

From novice to tech pro — start learning today.

Experts Exchange Solution brought to you by

Enjoy your complimentary solution view.

Get every solution instantly with Premium.
Start your 7-day free trial.