natural-time-js 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +1 -2
  2. package/context.js +3 -7
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -32,7 +32,7 @@ You can play with natural time at [https://naturaltime.app/](https://naturaltime
32
32
  Install NPM package with your terminal:
33
33
 
34
34
  ```console
35
- npm install -i natural-time-js
35
+ npm install natural-time-js
36
36
  ```
37
37
 
38
38
  ## `NaturalDate` Class
@@ -117,7 +117,6 @@ NaturalSunEvents(naturalDate, latitude);
117
117
  // eveningGoldenHour: 277.58920993448896
118
118
 
119
119
  NaturalMoonPosition(naturalDate, latitude);
120
- // position: 526.0620760764069,
121
120
  // phase: 74.86175469141531,
122
121
  // altitude: 64.32391838504756,
123
122
  // highestAltitude: 69.53997976716451
package/context.js CHANGED
@@ -80,7 +80,7 @@ export function NaturalSunEvents(naturalDate, latitude) {
80
80
  }
81
81
 
82
82
  /**
83
- * MOON POSITION
83
+ * MOON PHASE & POSITION
84
84
  *
85
85
  * Determines moon's position in the sky at specific natural date and lat/long position
86
86
  * @param {NaturalDate} naturalDate
@@ -92,19 +92,15 @@ export function NaturalMoonPosition(naturalDate, latitude) {
92
92
  let observer = new Observer(latitude, naturalDate.longitude, 0);
93
93
  let date = new Date(naturalDate.unixTime);
94
94
 
95
- // PHASE & POSITION
95
+ // PHASE
96
96
  let moonPhase = MoonPhase(date);
97
-
98
97
  let moon = Equator(Body.Moon, date, observer, true, false);
99
- let moonHorizon = Horizon(date, observer, moon.ra, moon.dec);
100
98
 
101
99
  // POSITION & ALTITUDE
102
- let moonPosition = moonHorizon.azimuth;
103
- let moonAltitude = Math.max(moonHorizon.altitude, 0);
100
+ let moonAltitude = Math.max(Horizon(date, observer, moon.ra, moon.dec).altitude, 0);
104
101
  let midmoon = SearchHourAngle(Body.Moon, observer, 0, new Date(naturalDate.nadir));
105
102
 
106
103
  return {
107
- position: moonPosition, // Moon needle position in time-degree (does not match exactly the position in the sky)
108
104
  phase: moonPhase, // 0 = new-moon, 90 = first quarter, 180 = full-moon, 270 = last quarter
109
105
  altitude: moonAltitude, // Current moon altitude
110
106
  highestAltitude: midmoon.hor.altitude // Highest altitude of the moon during the day
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "natural-time-js",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Natural time is a fresh, elegant, and coherent way of measuring the movements of time here on the Earth. This new time standard is based on common sense and the observation of natural cycles. Learn more: https://naturaltime.app. This JavaScript Class translates gregorian artificial datetime to natural datetime",
5
5
  "main": "index.js",
6
6
  "scripts": {