PHP calculates the maximum minimum latitude and longitude of 4 corners in the current coordinates of 3 km, the current latitude and longitude degree
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.
Articles you may be interested in:
- PHP gets all the information (address, ZIP code, country, latitude, longitude, etc.) of the specified (guest) IP
- PHP calculates distances based on latitude and longitude between two points
- PHP calculates the distance code between 2-point latitude and longitude
- PHP uses Jpgraph to draw complex X-y coordinate graphs
- PHP uses Jpgraph to draw a simple x-Y coordinate chart method
- PHP calculates the distance between two coordinates (longitude, latitude)
- PHP calculates the distance between two GPS coordinates of Baidu map
http://www.bkjia.com/PHPjc/1104333.html www.bkjia.com true http://www.bkjia.com/PHPjc/1104333.html techarticle PHP calculates the current coordinates of 3 kilometers in 4 corners of the maximum minimum latitude and longitude instance, the current latitude and longitude of this article describes the PHP calculation of the current coordinate 3 kilometers in 4 corners of the maximum minimum latitude and longitude of the square ...