PHP calculates the maximum minimum latitude and longitude of 4 corners in the current coordinates 3 km, current latitude and longitude _php tutorial

Source: Internet
Author: User
Tags php database

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 ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.