Plot decimal degree Latitude longitude in an XY coordinates(meters) - latitude-longitude

I have a set of Lat-long values of various locations on the map.
Eg.
(18.605906724686033, 73.14103329678608)
(18.606069075261992, 73.13979277511669)
(18.606066194308486, 73.13996845980716)
(18.60624633887108, 73.1400100340469)
I need to plot them in a graph (in meters) with the first position as the origin.
Please help me with the formulae for the conversion.
Thank you for answering.

x0= 18.605906724686033 //origin longitude
y0= 73.14103329678608 //origin latitude
x1= 18.606069075261992 //longidute
y1= 73.13979277511669 //latitude
dlong=x1-x2
dlat=y1-y2.
x=dlong*111139. //the x-cordinate for the given longitude
y=dlat*111190 //The y-cordinate for the given latitude

Related

Having the latitude and longitude, plotting in 2d, can I use the 3d formula?

This equations takes in latitude and longitude and returns the y and x coordinates :
y = R * cos(latitude) * sin(longitude);
x = R * cos(latitude) * cos(longitude);
example longitude and latitude :
"lat": 19.0733000,
"lon": 82.9479000,
z coordinate does not exist as its 2d.
Now I get some sort of map part displayed but not so correct in most cases, I googled converting from longitude latitude, and as openStreetMap uses Mercator projection, but using I have a separate question, that how to deal with plotting floating point number values of x and y on screen ?
How the formula can be applied ?
And why using the equation I am using is in appropriate ?
No, you cannot use the above formula to plot in a 2d plane. Trying (0N, 0E) gives coordinates (
R, 0) and (0N, 90E) gives coordinates (0, R).
This gis link discusses the Mercator projection: https://gis.stackexchange.com/questions/20686/mercator-projection-problem-with-latitude-formula

CoreLocation - what do the latitude and longitude numbers actually represent

I have :
+37.785834 (lat)
-122.406417 (long)
The LAT positive means North of the equator
The LONG negative means to the West of 0
So far so good.
But what does the number represent exactly ? For example suppose I added 0.000001 to the LAT what would this actually represent ? That I have moved in some Northerly direction by 1 metre, for example or....
If I understand what these numbers actually represent then I can use them intelligently.
Longitude and latitude are measured in degrees. The latitude ranges from -90° (south pole) to +90° (north pole). The longitude ranges from -180° to +180°.

How to calculate angle between two Geographical/GPS coordinates?

I have two GPS Coordinates
e.g. (Lat1, Long1) and (Lat2,Long2)
Could anybody please help me find the angle between those two points.
Values should be 0-360 degrees.
Taken from this previous SO post:
float dy = lat2 - lat1;
float dx = cosf(M_PI/180*lat1)*(long2 - long1);
float angle = atan2f(dy, dx);
I suppose you mean the bearing to and not the angle between the locations: If (lat1,long1) is stored in a Location object loc1 and (lat2,long2) is stored in loc2 you get the bearing from loc1 to loc2 like this:
float bearing = loc1.bearingTo(loc2);
The result is in degrees east of true north and its the initial bearing (which is important if loc1 and loc2 are far apart from each other).
There are some other useful methods in the Location class, see here for more details: http://developer.android.com/reference/android/location/Location.html
EDIT: I assumed Android for the answer, but yes, the tags do not imply that ...

How to calculate a longitude and latitude at a given distance along a great circle?

I want to overlay great circle arcs between airports on a map using longitudes and latitudes.
I can already get the distance and bearing from the initial and final coordinates but now I need to produce the points on the curve to plot through.
What I would like is a formula which takes the origin, destination, and a distance, and returns the latitude/longitude of the point that lies at that distance on the path between the origin and the destination.
I'm currently approximating the earth by a sphere and using radians -- eventually I'll add in spheroid corrections.
currlat = oldlat + d * sin (angle)/ (radius);
currlon = oldlon + d * cos (angle)/ (radius * cos(oldlat));
where d is distance travelled and angle is in radians. This is assuming circumference of earth at 40000km both at equator and through the poles. You can convert in radians...
Also it assumes the angle (direction) is with reference to equator line.
Obviously this needs spheroid corrections.
if you go south sin values will turn negative and north it will go positive. If you go west cos will turn negative and east it will turn positive.
d * sin(angle) and d * cos(angle) gives you the change. and you just calculate the new lat/long on that basis scaling up against circumference of earth.

How to find latitude and longitude

I have latitude and longitude of a point.I have to find out the latitude and longitude of another point from a relative distance from the known point.For example point A has some location with latitude and longitude.What is the latitude and longitude after moving 1000m south and 500m west from point A.Is there any direct equation to find this? Thanks in advance
Note the accepted answer is basically the flat earth projection equations:
x = δlon * EarthRadius * cos( lat )
y = δlat * EarthRadius
For better accuracy over larger distances, you should compute the final lat/lon from a typical bearing/range calculation. See the section Destination point given distance and bearing from start point at this website: http://www.movable-type.co.uk/scripts/latlong.html
Instead of looking up an equation you can calculate as follows. Let R be the radius of the Earth. Let a be the current latitude and b be the current longitude. Then if you move δx metres east (negative for west) then δy metres south, calculating the new longitude can be done as follows.
Intersecting a horizontal plane with the Earth at the current latitude will give you a circle of radius R*cos(a). So to convert δx to the change in longitude, you get something like
δlong = δx * 2π / (2π * R * cos(a)) = δx / (R * cos (a))
The change in latitude is easier, since it doesn't depend on the current position. You're always moving around a great circle through the two poles. Then δlat = δy / R. (Of course you need to mod out by 2 π at some point).