PHP code example of team-a / geo
1. Go to this page and download the library: Download team-a/geo library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
team-a / geo example snippets
use TeamA\Geo;
$Tver = Geo\Point::create(56.8598, 35.8948);
$SouthPole = Geo\Point::create(-90.0, 0);
$distance = (
new Geo\Line($Tver, $SouthPole)
)
->getDistance()
;
$point2ToSouthPoleLine = Geo\Line::createByBearing($Tver, 90.0, 1000.0);
$initialBearingToSouthPole = $point2ToSouthPoleLine->getInitialBearing();
$finalBearingToSouthPole = $point2ToSouthPoleLine->getFinalBearing();
$midPoint = $point2ToSouthPoleLine->getMidPoint();