Search code examples
latitude-longitudelocation-servicescartesian-coordinates

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


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.


Solution

  • 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