Skip to content

Commit

Permalink
Merge pull request #33 from WimDeMeester/master
Browse files Browse the repository at this point in the history
Calculate coordinates of the sun
  • Loading branch information
WimDeMeester authored Sep 22, 2020
2 parents b5bce58 + 87527d5 commit 39faf60
Show file tree
Hide file tree
Showing 7 changed files with 471 additions and 70 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/vendor
.env
.phpunit.result.cache
composer.lock
6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All notable changes to `laravel-astronomy-library` will be documented in this file.

## Version 4.9

### Added

- Add methods to calculate the equatorial coordinates of the sun.

## Version 4.8

### Added
Expand Down
116 changes: 58 additions & 58 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,10 @@ $precessed_coords = $coords->precession($date);
$coords = new EquatorialCoordinates(10.13952778, 11.967222, 2000.0, -0.0169, 0.006);
$date = Carbon::createMidnightDate(1978, 1, 1);
$precessed_coords = $coords->precessionHighAccuracy($date);

// Calculate the apparent place of an object
$coords = new EquatorialCoordinates(2.736662778, 49.22846667, 2000.0, 0.03425, -0.0895);
$appararentPlace = $coords->apparentPlace($date, $nutation);
```

### Coordinate methods on ecliptical coordinates
Expand Down Expand Up @@ -358,6 +362,18 @@ echo $target->getBestTimeToObserve();
// Return the altitude graph for the target for the given date
// In blade:
{!! $target->getAltitudeGraph() !!}

// Calculate the equatorial coordinates of the sun in low accuracy
$sun = new Sun();
$nutation = Time::nutation(Time::getJd($date));
$sun->calculateEquatorialCoordinates($date, $nutation[3]);
$coordinates = $sun->getEquatorialCoordinates();

// Calculate the equatorial coordinates of the sun in high accuracy
$sun = new Sun();
$nutation = Time::nutation(Time::getJd($date));
$sun->calculateEquatorialCoordinatesHighAccuracy($date, $nutation);
$coordinates = $sun->getEquatorialCoordinates();
```

## Change log
Expand Down
Loading

0 comments on commit 39faf60

Please sign in to comment.