Calculate min distance between a “line” and one “point”
问题 I have a "linestring" (with init and end points) and a single "point" (two coordinates). And I have implemented the following ActionSctipt code to use "haversine formula" to calculate the distance between two points (each point has x & y coordinates); this function can return the "distance" in "kms", "meters", "feets" or "miles": private function distanceBetweenCoordinates(lat1:Number, lon1:Number, lat2:Number, lon2:Number, units:String = "miles"):Number { var R:int = RADIUS_OF_EARTH_IN_MILES