1. Go to this page and download the library: Download andrmoel/astronomy-bundle 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/ */
$location = Location::create(44.61040, -121.23848); // Madras, OR
$toi = TimeOfInterest::createFromString('2017-08-21'); // Date of the eclipse (UTC)
$solarEclipse = SolarEclipse::create($toi, $location);
$location = Location::create(44.61040, -121.23848); // Madras, OR
$toi = TimeOfInterest::createFromString('2017-08-21'); // Date of the eclipse (UTC)
$solarEclipse = SolarEclipse::create($toi, $location);
$type = $solarEclipse->getEclipseType();
$duration = $solarEclipse->getEclipseDuration(); // in seconds
$durationTotality = $solarEclipse->getEclipseUmbraDuration(); // in seconds
$obscuration = $solarEclipse->getObscuration();
$magnitude = $solarEclipse->getMagnitude();
$moonSunRatio = $solarEclipse->getMoonSunRatio();
$location = Location::create(52.52, 13.405); // Berlin
$toi = TimeOfInterest::createFromString('2015-03-20'); // Date of the eclipse (UTC)
$solarEclipse = SolarEclipse::create($toi, $location);
$type = $solarEclipse->getEclipseType();
$duration = $solarEclipse->getEclipseDuration(); // in seconds
$durationTotality = $solarEclipse->getEclipseUmbraDuration(); // in seconds
$obscuration = $solarEclipse->getObscuration();
$magnitude = $solarEclipse->getMagnitude();
$moonSunRatio = $solarEclipse->getMoonSunRatio();
$location = Location::create(44.61040, -121.23848); // Madras, OR
$toi = TimeOfInterest::createFromString('2017-08-21'); // Date of the eclipse (UTC)
$solarEclipse = SolarEclipse::create($toi, $location);
$c1 = $solarEclipse->getCircumstancesC1();
$c2 = $solarEclipse->getCircumstancesC2();
$max = $solarEclipse->getCircumstancesMax();
$c3 = $solarEclipse->getCircumstancesC3();
$c4 = $solarEclipse->getCircumstancesC4();
$location = Location::create(44.61040, -121.23848); // Madras, OR
$toi = TimeOfInterest::createFromString('2017-08-21'); // Date of the eclipse (UTC)
$solarEclipse = SolarEclipse::create($toi, $location);
$c2 = $solarEclipse->getCircumstancesC2();
// Get time for C2
$toiC2 = $solarEclipse->getTimeOfInterest($c2);
// Get local horizontal coordinates (azimuth, altitude) of C2
$locHorCoord = $c2->getLocalHorizontalCoordinates();
$azimuth = $locHorCoord->getAzimuth();
$altitude = $locHorCoord->getAltitude();
$location1 = Location::create(52.524, 13.411); // Berlin
$location2 = Location::create(40.697,-74.539); // New York
$distance = EarthCalc::getDistanceBetweenLocations($location1, $location2);