This example describes the PHP method for calculating the maximum minimum latitude and longitude of 4 corners in the current coordinates of 3 km. Share to everyone for your reference, as follows:
$LNG, $lat latitude and longitude $half = 6371; $distance = 3; 3 km $DLNG = 2 * ASIN (SIN ($distance/(2 * $half))/cos (Deg2rad ($lat))); $DLNG = Rad2deg ($DLNG); $dlat = $distance/$half; $dlat = Rad2deg ($dlat); $fourpoint = Array (' left-top ' = = Array (' lat ' = = $lat + $dlat, ' lng ' = = $lng-$dlng), ' right-top ' = The array (' lat ' = = $lat + $dlat, ' lng ' = + $lng + $dlng), ' left-bottom ' = = Array (' lat ' = + $lat-$dlat, ' LNG ' = > $LNG-$dlng), ' right-bottom ' = = Array (' lat ' = = $lat-$dlat, ' lng ' = + $lng + $dlng));
More readers interested in PHP related content can view the topic: "PHP Date and Time usage summary", "PHP Object-oriented Programming tutorial", "PHP string (String) Usage Summary", "Php+mysql database operation Getting Started tutorial" and " A summary of common PHP database operation techniques
I hope this article is helpful to you in PHP programming.
The above describes the PHP calculation of the current coordinates of 3 kilometers in 4 corners of the largest minimum latitude and longitude examples, including the content of the text, I hope that the PHP tutorial interested friends helpful.