Latitude / Longitude Distance Calculation

Quick question about calculating Lat / Long.

I want to take a value, for example. Lat: 55.123456 Long -6.123456 and work out four points that are at an arbitrary distance.

enter image description here

As a given square, I want to work out a value for Latitude on the left and right. Thus, the red lines are 1.5 km from the starting point. Similarly, for longitude, the blue lines will be 1.5 km from the starting point. The exit will be 4 points, all distances in kilometers.

In short: Latitude + Y = Latitude Value in kilometers X

Work with the iPhone at the moment and its for a very rough calculation of the database.

EDIT: just to clarify, the distance is so short that curvature (and therefore accuracy) is not a problem.

+5
source
3

OBJ-C :

float r_earth = 6378 * 1000; //Work in meters for everything
float dy = 3000; //A point 3km away
float dx = 3000; //A point 3km away
float new_latitude  = latitude  + (dy / r_earth) * (180 / M_PI);
float new_longitude = longitude + (dx / r_earth) * (180 / M_PI) / cos(latitude * 180/M_PI);
+6

, ( 100 ) , 40_000_000/360 = 111 111 111 111 * cos () . , 1/40_000_000 ;).

, . , , .

+3
// parameter: offset in meters
float offsetM = 1500; // 1.5km

// degrees / earth circumfence
float degreesPerMeter = 360.0 / 40 000 000;
float toRad = 180 / M_PI;

float latOffsetMeters = offsetM * degreesPerMeter;
float lonOffsetMeters = offsetM * degreesPerMeter * cos (centerLatitude * toRad);

+/- latOffsetMeters +/- lonOffsetMeters Latitude/centerLongitude.

.

+1

All Articles