lat lon to meter

Creator
Creator
Seonglae ChoSeonglae Cho
Created
Created
2020 Aug 20 3:18
Editor
Edited
Edited
2023 Jul 31 16:9
Refs
Refs
function latlonToMeter(lat1, lon1, lat2, lon2) { const R = 6378.137 const dLat = lat2 * Math.PI / 180 - lat1 * Math.PI / 180 const dLon = lon2 * Math.PI / 180 - lon1 * Math.PI / 180 const a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + Math.cos(lat1 * Math.PI / 180) * Math.cos(lat2 * Math.PI / 180) * Math.sin(dLon / 2) * Math.sin(dLon / 2) const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)) const d = R * c return d * 1000 }
 
 
 
 
How to convert latitude or longitude to meters?
Thanks for contributing an answer to Stack Overflow! Please be sure to answer the question. Provide details and share your research! Asking for help, clarification, or responding to other answers. Making statements based on opinion; back them up with references or personal experience. To learn more, see our tips on writing great answers.
How to convert latitude or longitude to meters?
 
 
 

Recommendations