Skip to content
This repository has been archived by the owner on Apr 25, 2020. It is now read-only.

Commit

Permalink
expose Time#hour_angle
Browse files Browse the repository at this point in the history
  • Loading branch information
Jay LaPorte committed Apr 4, 2019
1 parent be16eb2 commit 9aefcc3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/solar.js
Expand Up @@ -160,12 +160,16 @@ class Time {
return _distance(julian.to(this.time));
}

hour_angle(lon) {
return sidereal.local(julian.to(this.time), lon) - this.right_ascension;
}

observer(lat, lon) {
lat *= RAD;
lon *= RAD;

// https://en.wikipedia.org/wiki/Hour_angle
const hour_angle = sidereal.local(julian.to(this.time), lon) - this.right_ascension;
const hour_angle = this.hour_angle(lon);

// Solar elevation angle.
// https://en.wikipedia.org/wiki/Solar_zenith_angle
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "astro",
"version": "2.0.1",
"version": "2.0.2",
"description": "Solar and lunar position calculations",
"main": "index.js",
"devDependencies": {
Expand Down

0 comments on commit 9aefcc3

Please sign in to comment.