iphone — convert MKMapPoint distances to meters

前端 未结 2 788
名媛妹妹
名媛妹妹 2021-01-07 02:32

Say I have a square which consists of four CLLocationCoordinate2D points, which are in lat, lon, and I want to find the area of the square in meters. I convert the CLLocati

2条回答
  •  感情败类
    2021-01-07 03:14

    You can use the Haversine formula to calculate it, assuming that the earth is a perfect sphere.

    To understand how lat/lon vs meters works in the context of the earth, you may find it interesting to read about Nautical miles.

    You can find some more resources and some sample code by googling objective-c Haversine formula.

    Enjoy!

提交回复
热议问题