ootk 3.0.0 → 4.0.0-0
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.
- package/.eslintrc.json +10 -10
- package/CHANGELOG.md +122 -0
- package/README.md +27 -40
- package/lib/coordinate/Hill.d.ts +50 -0
- package/lib/coordinate/Hill.js +214 -0
- package/lib/coordinate/Hill.js.map +1 -0
- package/lib/coordinate/index.d.ts +1 -0
- package/lib/coordinate/index.js +2 -0
- package/lib/coordinate/index.js.map +1 -0
- package/lib/covariance/CovarianceSample.d.ts +44 -0
- package/lib/covariance/CovarianceSample.js +146 -0
- package/lib/covariance/CovarianceSample.js.map +1 -0
- package/lib/covariance/StateCovariance.d.ts +41 -0
- package/lib/covariance/StateCovariance.js +62 -0
- package/lib/covariance/StateCovariance.js.map +1 -0
- package/lib/force/AtmosphericDrag.d.ts +32 -0
- package/lib/force/AtmosphericDrag.js +66 -0
- package/lib/force/AtmosphericDrag.js.map +1 -0
- package/lib/force/EarthGravity.d.ts +28 -0
- package/lib/force/EarthGravity.js +115 -0
- package/lib/force/EarthGravity.js.map +1 -0
- package/{dist/ootk.d.ts → lib/force/Force.d.ts} +10 -10
- package/lib/force/Force.js +30 -0
- package/lib/force/Force.js.map +1 -0
- package/lib/force/ForceModel.d.ts +38 -0
- package/lib/force/ForceModel.js +71 -0
- package/lib/force/ForceModel.js.map +1 -0
- package/lib/force/Gravity.d.ts +41 -0
- package/lib/force/Gravity.js +48 -0
- package/lib/force/Gravity.js.map +1 -0
- package/lib/force/SolarRadiationPressure.d.ts +27 -0
- package/lib/force/SolarRadiationPressure.js +42 -0
- package/lib/force/SolarRadiationPressure.js.map +1 -0
- package/lib/force/ThirdBodyGravity.d.ts +27 -0
- package/lib/force/ThirdBodyGravity.js +56 -0
- package/lib/force/ThirdBodyGravity.js.map +1 -0
- package/lib/force/Thrust.d.ts +35 -0
- package/lib/force/Thrust.js +53 -0
- package/lib/force/Thrust.js.map +1 -0
- package/lib/interpolator/ChebyshevCoefficients.d.ts +54 -0
- package/lib/interpolator/ChebyshevCoefficients.js +90 -0
- package/lib/interpolator/ChebyshevCoefficients.js.map +1 -0
- package/lib/interpolator/ChebyshevInterpolator.d.ts +39 -0
- package/lib/interpolator/ChebyshevInterpolator.js +71 -0
- package/lib/interpolator/ChebyshevInterpolator.js.map +1 -0
- package/lib/interpolator/CubicSpline.d.ts +36 -0
- package/lib/interpolator/CubicSpline.js +64 -0
- package/lib/interpolator/CubicSpline.js.map +1 -0
- package/lib/interpolator/CubicSplineInterpolator.d.ts +37 -0
- package/lib/interpolator/CubicSplineInterpolator.js +78 -0
- package/lib/interpolator/CubicSplineInterpolator.js.map +1 -0
- package/lib/interpolator/FieldInterpolator.d.ts +26 -0
- package/lib/interpolator/FieldInterpolator.js +31 -0
- package/lib/interpolator/FieldInterpolator.js.map +1 -0
- package/lib/interpolator/Interpolator.d.ts +23 -0
- package/lib/interpolator/Interpolator.js +48 -0
- package/lib/interpolator/Interpolator.js.map +1 -0
- package/lib/interpolator/LagrangeInterpolator.d.ts +42 -0
- package/lib/interpolator/LagrangeInterpolator.js +156 -0
- package/lib/interpolator/LagrangeInterpolator.js.map +1 -0
- package/lib/interpolator/StateInterpolator.d.ts +29 -0
- package/lib/interpolator/StateInterpolator.js +37 -0
- package/lib/interpolator/StateInterpolator.js.map +1 -0
- package/lib/interpolator/VerletBlendInterpolator.d.ts +44 -0
- package/lib/interpolator/VerletBlendInterpolator.js +115 -0
- package/lib/interpolator/VerletBlendInterpolator.js.map +1 -0
- package/lib/maneuver/TwoBurnOrbitTransfer.d.ts +43 -0
- package/lib/maneuver/TwoBurnOrbitTransfer.js +62 -0
- package/lib/maneuver/TwoBurnOrbitTransfer.js.map +1 -0
- package/lib/maneuver/Waypoint.d.ts +66 -0
- package/lib/maneuver/Waypoint.js +152 -0
- package/lib/maneuver/Waypoint.js.map +1 -0
- package/lib/objects/DetailedSatellite.d.ts +94 -0
- package/lib/objects/DetailedSatellite.js +140 -0
- package/lib/objects/DetailedSatellite.js.map +1 -0
- package/lib/objects/DetailedSensor.d.ts +43 -0
- package/lib/objects/DetailedSensor.js +45 -0
- package/lib/objects/DetailedSensor.js.map +1 -0
- package/{dist/objects/space-object.d.ts → lib/objects/LandObject.d.ts} +19 -21
- package/lib/objects/LandObject.js +28 -0
- package/lib/objects/LandObject.js.map +1 -0
- package/lib/objects/Marker.d.ts +21 -0
- package/lib/objects/Marker.js +25 -0
- package/lib/objects/Marker.js.map +1 -0
- package/lib/objects/index.d.ts +5 -4
- package/lib/objects/index.js +5 -4
- package/lib/objects/index.js.map +1 -1
- package/lib/observation/Observation.d.ts +51 -0
- package/lib/observation/Observation.js +71 -0
- package/lib/observation/Observation.js.map +1 -0
- package/lib/observation/ObservationOptical.d.ts +47 -0
- package/lib/observation/ObservationOptical.js +101 -0
- package/lib/observation/ObservationOptical.js.map +1 -0
- package/lib/observation/ObservationRadar.d.ts +43 -0
- package/lib/observation/ObservationRadar.js +90 -0
- package/lib/observation/ObservationRadar.js.map +1 -0
- package/lib/observation/ObservationUtils.d.ts +21 -0
- package/lib/observation/ObservationUtils.js +33 -0
- package/lib/observation/ObservationUtils.js.map +1 -0
- package/lib/observation/PropagatorPairs.d.ts +31 -0
- package/lib/observation/PropagatorPairs.js +40 -0
- package/lib/observation/PropagatorPairs.js.map +1 -0
- package/lib/ootk.d.ts +10 -8
- package/lib/ootk.js +10 -8
- package/lib/ootk.js.map +1 -1
- package/lib/operations/BoxMuller.d.ts +41 -0
- package/lib/operations/BoxMuller.js +66 -0
- package/lib/operations/BoxMuller.js.map +1 -0
- package/lib/operations/EulerAngles.d.ts +50 -0
- package/lib/operations/EulerAngles.js +111 -0
- package/lib/operations/EulerAngles.js.map +1 -0
- package/lib/operations/Quaternion.d.ts +57 -0
- package/lib/operations/Quaternion.js +164 -0
- package/lib/operations/Quaternion.js.map +1 -0
- package/lib/operations/RandomGaussianSource.d.ts +25 -0
- package/lib/operations/RandomGaussianSource.js +43 -0
- package/lib/operations/RandomGaussianSource.js.map +1 -0
- package/lib/operations/index.d.ts +4 -0
- package/lib/operations/index.js +5 -0
- package/lib/operations/index.js.map +1 -0
- package/lib/optimize/ChebyshevCompressor.d.ts +31 -0
- package/lib/optimize/ChebyshevCompressor.js +80 -0
- package/lib/optimize/ChebyshevCompressor.js.map +1 -0
- package/lib/optimize/DownhillSimplex.d.ts +50 -0
- package/lib/optimize/DownhillSimplex.js +168 -0
- package/lib/optimize/DownhillSimplex.js.map +1 -0
- package/lib/optimize/GoldenSection.d.ts +33 -0
- package/lib/optimize/GoldenSection.js +49 -0
- package/lib/optimize/GoldenSection.js.map +1 -0
- package/lib/optimize/PolynomialRegression.d.ts +37 -0
- package/lib/optimize/PolynomialRegression.js +66 -0
- package/lib/optimize/PolynomialRegression.js.map +1 -0
- package/lib/optimize/PolynomicalRegressionResult.d.ts +28 -0
- package/lib/optimize/PolynomicalRegressionResult.js +32 -0
- package/lib/optimize/PolynomicalRegressionResult.js.map +1 -0
- package/lib/optimize/SimpleLinearRegression.d.ts +41 -0
- package/lib/optimize/SimpleLinearRegression.js +107 -0
- package/lib/optimize/SimpleLinearRegression.js.map +1 -0
- package/lib/optimize/SimplexEntry.d.ts +33 -0
- package/lib/optimize/SimplexEntry.js +39 -0
- package/lib/optimize/SimplexEntry.js.map +1 -0
- package/lib/orbit_determination/BatchLeastSquaresOD.d.ts +54 -0
- package/lib/orbit_determination/BatchLeastSquaresOD.js +118 -0
- package/lib/orbit_determination/BatchLeastSquaresOD.js.map +1 -0
- package/lib/orbit_determination/BatchLeastSquaresResult.d.ts +29 -0
- package/lib/orbit_determination/BatchLeastSquaresResult.js +31 -0
- package/lib/orbit_determination/BatchLeastSquaresResult.js.map +1 -0
- package/lib/orbit_determination/GibbsIOD.d.ts +33 -0
- package/lib/orbit_determination/GibbsIOD.js +70 -0
- package/lib/orbit_determination/GibbsIOD.js.map +1 -0
- package/lib/orbit_determination/GoodingIOD.d.ts +52 -0
- package/lib/orbit_determination/GoodingIOD.js +244 -0
- package/lib/orbit_determination/GoodingIOD.js.map +1 -0
- package/lib/{objects/space-object.d.ts → orbit_determination/HerrickGibbsIOD.d.ts} +17 -22
- package/lib/orbit_determination/HerrickGibbsIOD.js +49 -0
- package/lib/orbit_determination/HerrickGibbsIOD.js.map +1 -0
- package/lib/orbit_determination/LambertIOD.d.ts +46 -0
- package/lib/orbit_determination/LambertIOD.js +199 -0
- package/lib/orbit_determination/LambertIOD.js.map +1 -0
- package/lib/orbit_determination/ModifiedGoodingIOD.d.ts +41 -0
- package/lib/orbit_determination/ModifiedGoodingIOD.js +82 -0
- package/lib/orbit_determination/ModifiedGoodingIOD.js.map +1 -0
- package/lib/propagator/DormandPrince54Propagator.d.ts +29 -0
- package/lib/propagator/DormandPrince54Propagator.js +68 -0
- package/lib/propagator/DormandPrince54Propagator.js.map +1 -0
- package/lib/propagator/KeplerPropagator.d.ts +36 -0
- package/lib/propagator/KeplerPropagator.js +81 -0
- package/lib/propagator/KeplerPropagator.js.map +1 -0
- package/lib/propagator/Propagator.d.ts +35 -0
- package/lib/propagator/Propagator.js +163 -0
- package/lib/propagator/Propagator.js.map +1 -0
- package/lib/propagator/RkCheckpoint.d.ts +23 -0
- package/lib/propagator/RkCheckpoint.js +26 -0
- package/lib/propagator/RkCheckpoint.js.map +1 -0
- package/lib/propagator/RkResult.d.ts +24 -0
- package/lib/propagator/RkResult.js +28 -0
- package/lib/propagator/RkResult.js.map +1 -0
- package/lib/propagator/RungeKutta4Propagator.d.ts +46 -0
- package/lib/propagator/RungeKutta4Propagator.js +132 -0
- package/lib/propagator/RungeKutta4Propagator.js.map +1 -0
- package/lib/propagator/RungeKutta89Propagator.d.ts +29 -0
- package/lib/propagator/RungeKutta89Propagator.js +130 -0
- package/lib/propagator/RungeKutta89Propagator.js.map +1 -0
- package/lib/propagator/RungeKuttaAdaptive.d.ts +52 -0
- package/lib/propagator/RungeKuttaAdaptive.js +152 -0
- package/lib/propagator/RungeKuttaAdaptive.js.map +1 -0
- package/lib/propagator/Sgp4Propagator.d.ts +35 -0
- package/lib/propagator/Sgp4Propagator.js +55 -0
- package/lib/propagator/Sgp4Propagator.js.map +1 -0
- package/lib/smoothing/ExponentialSmoothing.d.ts +24 -0
- package/lib/smoothing/ExponentialSmoothing.js +82 -0
- package/lib/smoothing/ExponentialSmoothing.js.map +1 -0
- package/lib/types/types.d.ts +65 -584
- package/lib/types/types.js +21 -33
- package/lib/types/types.js.map +1 -1
- package/package.json +16 -14
- package/.prettierrc +0 -17
- package/babel.config.js +0 -16
- package/codecov.yml +0 -21
- package/dist/objects/base-object.d.ts +0 -40
- package/dist/objects/detailed-sat.d.ts +0 -66
- package/dist/objects/index.d.ts +0 -4
- package/dist/objects/sat.d.ts +0 -92
- package/dist/objects/sensor.d.ts +0 -93
- package/dist/objects/star.d.ts +0 -46
- package/dist/ootk.js +0 -2
- package/dist/ootk.js.LICENSE.txt +0 -77
- package/dist/sgp4/sgp4.d.ts +0 -82
- package/dist/tle/tle-format-data.d.ts +0 -6
- package/dist/tle/tle.d.ts +0 -375
- package/dist/transforms/transforms.d.ts +0 -94
- package/dist/types/types.d.ts +0 -605
- package/dist/utils/constants.d.ts +0 -34
- package/dist/utils/moon-math.d.ts +0 -113
- package/dist/utils/sun-math.d.ts +0 -230
- package/dist/utils/utils.d.ts +0 -39
- package/lib/objects/base-object.d.ts +0 -40
- package/lib/objects/base-object.js +0 -79
- package/lib/objects/base-object.js.map +0 -1
- package/lib/objects/detailed-sat.d.ts +0 -66
- package/lib/objects/detailed-sat.js +0 -149
- package/lib/objects/detailed-sat.js.map +0 -1
- package/lib/objects/sat.d.ts +0 -92
- package/lib/objects/sat.js +0 -188
- package/lib/objects/sat.js.map +0 -1
- package/lib/objects/sensor.d.ts +0 -93
- package/lib/objects/sensor.js +0 -273
- package/lib/objects/sensor.js.map +0 -1
- package/lib/objects/space-object.js +0 -60
- package/lib/objects/space-object.js.map +0 -1
- package/lib/objects/star.d.ts +0 -46
- package/lib/objects/star.js +0 -91
- package/lib/objects/star.js.map +0 -1
- package/lib/sgp4/sgp4.d.ts +0 -82
- package/lib/sgp4/sgp4.js +0 -3262
- package/lib/sgp4/sgp4.js.map +0 -1
- package/lib/tle/tle-format-data.d.ts +0 -6
- package/lib/tle/tle-format-data.js +0 -10
- package/lib/tle/tle-format-data.js.map +0 -1
- package/lib/tle/tle.d.ts +0 -375
- package/lib/tle/tle.js +0 -611
- package/lib/tle/tle.js.map +0 -1
- package/lib/transforms/transforms.d.ts +0 -94
- package/lib/transforms/transforms.js +0 -308
- package/lib/transforms/transforms.js.map +0 -1
- package/lib/utils/constants.d.ts +0 -34
- package/lib/utils/constants.js +0 -35
- package/lib/utils/constants.js.map +0 -1
- package/lib/utils/moon-math.d.ts +0 -113
- package/lib/utils/moon-math.js +0 -387
- package/lib/utils/moon-math.js.map +0 -1
- package/lib/utils/sun-math.d.ts +0 -230
- package/lib/utils/sun-math.js +0 -422
- package/lib/utils/sun-math.js.map +0 -1
- package/lib/utils/utils.d.ts +0 -39
- package/lib/utils/utils.js +0 -102
- package/lib/utils/utils.js.map +0 -1
- package/sandbox.html +0 -8
- package/tsconfig.base.json +0 -31
- package/tsconfig.build.json +0 -14
- /package/{LICENSE.MD → LICENSE.md} +0 -0
package/lib/utils/moon-math.js
DELETED
|
@@ -1,387 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author Theodore Kruczek.
|
|
3
|
-
* @description Orbital Object ToolKit (OOTK) is a collection of tools for working
|
|
4
|
-
* with satellites and other orbital objects.
|
|
5
|
-
*
|
|
6
|
-
* @file MoonMath is a an extension to SunMath for calculating the position of the moon
|
|
7
|
-
* and its phases. This was originally created by Vladimir Agafonkin. Robert Gester's
|
|
8
|
-
* update was referenced for documentation. There were a couple of bugs in both versions
|
|
9
|
-
* so there will be some differences if you are migrating from either to this library.
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* @license AGPL-3.0-or-later
|
|
13
|
-
* @Copyright (c) 2020-2023 Theodore Kruczek
|
|
14
|
-
*
|
|
15
|
-
* @Copyright (c) 2011-2015, Vladimir Agafonkin
|
|
16
|
-
* SunCalc is a JavaScript library for calculating sun/moon position and light phases.
|
|
17
|
-
* https://github.com/mourner/suncalc
|
|
18
|
-
*
|
|
19
|
-
* Reworked and enhanced by Robert Gester
|
|
20
|
-
* @Copyright (c) 2022 Robert Gester
|
|
21
|
-
* https://github.com/hypnos3/suncalc3
|
|
22
|
-
*
|
|
23
|
-
* moon calculations, based on http://aa.quae.nl/en/reken/hemelpositie.html formulas
|
|
24
|
-
*
|
|
25
|
-
* Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
|
|
26
|
-
* terms of the GNU Affero General Public License as published by the Free Software
|
|
27
|
-
* Foundation, either version 3 of the License, or (at your option) any later version.
|
|
28
|
-
*
|
|
29
|
-
* Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
30
|
-
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
31
|
-
* See the GNU Affero General Public License for more details.
|
|
32
|
-
*
|
|
33
|
-
* You should have received a copy of the GNU Affero General Public License along with
|
|
34
|
-
* Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
|
|
35
|
-
*/
|
|
36
|
-
import { MS_PER_DAY } from '../utils/constants';
|
|
37
|
-
import { DEG2RAD } from './constants';
|
|
38
|
-
import { SunMath } from './sun-math';
|
|
39
|
-
var MoonMath = /** @class */ (function () {
|
|
40
|
-
function MoonMath() {
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* calculations for illumination parameters of the moon,
|
|
44
|
-
* based on http://idlastro.gsfc.nasa.gov/ftp/pro/astro/mphase.pro formulas and
|
|
45
|
-
* Chapter 48 of "Astronomical Algorithms" 2nd edition by Jean Meeus (Willmann-Bell, Richmond) 1998.
|
|
46
|
-
* @param {number | Date} date Date object or timestamp for calculating moon-illumination
|
|
47
|
-
* @return {MoonIlluminationData} result object of moon-illumination
|
|
48
|
-
*/
|
|
49
|
-
// eslint-disable-next-line max-statements
|
|
50
|
-
MoonMath.getMoonIllumination = function (date) {
|
|
51
|
-
var dateValue = date instanceof Date ? date.getTime() : date;
|
|
52
|
-
var lunarDaysMs = 2551442778; // The duration in days of a lunar cycle is 29.53058770576 days.
|
|
53
|
-
var firstNewMoon2000 = 947178840000; // first newMoon in the year 2000 2000-01-06 18:14
|
|
54
|
-
var d = SunMath.date2jSince2000(new Date(dateValue));
|
|
55
|
-
var s = SunMath.getSunRaDec(d);
|
|
56
|
-
var m = MoonMath.moonCoords(d);
|
|
57
|
-
var sdist = 149598000; // distance from Earth to Sun in km
|
|
58
|
-
var phi = Math.acos(Math.sin(s.dec) * Math.sin(m.dec) + Math.cos(s.dec) * Math.cos(m.dec) * Math.cos(s.ra - m.ra));
|
|
59
|
-
var inc = Math.atan2(sdist * Math.sin(phi), m.dist - sdist * Math.cos(phi));
|
|
60
|
-
var angle = Math.atan2(Math.cos(s.dec) * Math.sin(s.ra - m.ra), Math.sin(s.dec) * Math.cos(m.dec) - Math.cos(s.dec) * Math.sin(m.dec) * Math.cos(s.ra - m.ra));
|
|
61
|
-
var phaseValue = 0.5 + (0.5 * inc * (angle < 0 ? -1 : 1)) / Math.PI;
|
|
62
|
-
// calculates the difference in ms between the sirst fullMoon 2000 and given Date
|
|
63
|
-
var diffBase = dateValue - firstNewMoon2000;
|
|
64
|
-
// Calculate modulus to drop completed cycles
|
|
65
|
-
var cycleModMs = diffBase % lunarDaysMs;
|
|
66
|
-
// If negative number (date before new moon 2000) add lunarDaysMs
|
|
67
|
-
if (cycleModMs < 0) {
|
|
68
|
-
cycleModMs += lunarDaysMs;
|
|
69
|
-
}
|
|
70
|
-
var nextNewMoon = lunarDaysMs - cycleModMs + dateValue;
|
|
71
|
-
var nextFullMoon = lunarDaysMs / 2 - cycleModMs + dateValue;
|
|
72
|
-
if (nextFullMoon < dateValue) {
|
|
73
|
-
nextFullMoon += lunarDaysMs;
|
|
74
|
-
}
|
|
75
|
-
var quater = lunarDaysMs / 4;
|
|
76
|
-
var nextFirstQuarter = quater - cycleModMs + dateValue;
|
|
77
|
-
if (nextFirstQuarter < dateValue) {
|
|
78
|
-
nextFirstQuarter += lunarDaysMs;
|
|
79
|
-
}
|
|
80
|
-
var nextThirdQuarter = lunarDaysMs - quater - cycleModMs + dateValue;
|
|
81
|
-
if (nextThirdQuarter < dateValue) {
|
|
82
|
-
nextThirdQuarter += lunarDaysMs;
|
|
83
|
-
}
|
|
84
|
-
/*
|
|
85
|
-
* Calculate the fraction of the moon cycle
|
|
86
|
-
* const currentfrac = cycleModMs / lunarDaysMs;
|
|
87
|
-
*/
|
|
88
|
-
var next = Math.min(nextNewMoon, nextFirstQuarter, nextFullMoon, nextThirdQuarter);
|
|
89
|
-
// eslint-disable-next-line init-declarations
|
|
90
|
-
var phase;
|
|
91
|
-
for (var index = 0; index < MoonMath.moonCycles_.length; index++) {
|
|
92
|
-
var element = MoonMath.moonCycles_[index];
|
|
93
|
-
if (phaseValue >= element.from && phaseValue <= element.to) {
|
|
94
|
-
phase = element;
|
|
95
|
-
break;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
var type = '';
|
|
99
|
-
if (next === nextNewMoon) {
|
|
100
|
-
type = 'newMoon';
|
|
101
|
-
}
|
|
102
|
-
else if (next === nextFirstQuarter) {
|
|
103
|
-
type = 'firstQuarter';
|
|
104
|
-
}
|
|
105
|
-
else if (next === nextFullMoon) {
|
|
106
|
-
type = 'fullMoon';
|
|
107
|
-
}
|
|
108
|
-
else {
|
|
109
|
-
type = 'thirdQuarter';
|
|
110
|
-
}
|
|
111
|
-
return {
|
|
112
|
-
fraction: (1 + Math.cos(inc)) / 2,
|
|
113
|
-
phase: phase,
|
|
114
|
-
phaseValue: phaseValue,
|
|
115
|
-
angle: angle,
|
|
116
|
-
next: {
|
|
117
|
-
value: next,
|
|
118
|
-
date: new Date(next).toISOString(),
|
|
119
|
-
type: type,
|
|
120
|
-
newMoon: {
|
|
121
|
-
value: nextNewMoon,
|
|
122
|
-
date: new Date(nextNewMoon).toISOString(),
|
|
123
|
-
},
|
|
124
|
-
fullMoon: {
|
|
125
|
-
value: nextFullMoon,
|
|
126
|
-
date: new Date(nextFullMoon).toISOString(),
|
|
127
|
-
},
|
|
128
|
-
firstQuarter: {
|
|
129
|
-
value: nextFirstQuarter,
|
|
130
|
-
date: new Date(nextFirstQuarter).toISOString(),
|
|
131
|
-
},
|
|
132
|
-
thirdQuarter: {
|
|
133
|
-
value: nextThirdQuarter,
|
|
134
|
-
date: new Date(nextThirdQuarter).toISOString(),
|
|
135
|
-
},
|
|
136
|
-
},
|
|
137
|
-
};
|
|
138
|
-
};
|
|
139
|
-
MoonMath.getMoonPosition = function (date, lat, lon) {
|
|
140
|
-
var lw = (DEG2RAD * -lon);
|
|
141
|
-
var phi = (DEG2RAD * lat);
|
|
142
|
-
var d = SunMath.date2jSince2000(date);
|
|
143
|
-
var c = MoonMath.moonCoords(d);
|
|
144
|
-
var H = SunMath.siderealTime(d, lw) - c.ra;
|
|
145
|
-
var h = SunMath.elevation(H, phi, c.dec);
|
|
146
|
-
// formula 14.1 of "Astronomical Algorithms" 2nd edition by Jean Meeus (Willmann-Bell, Richmond) 1998.
|
|
147
|
-
var pa = Math.atan2(Math.sin(H), Math.tan(phi) * Math.cos(c.dec) - Math.sin(c.dec) * Math.cos(H));
|
|
148
|
-
h = (h + SunMath.astroRefraction(h)); // altitude correction for refraction
|
|
149
|
-
return {
|
|
150
|
-
az: SunMath.azimuth(H, phi, c.dec),
|
|
151
|
-
el: h,
|
|
152
|
-
rng: c.dist,
|
|
153
|
-
parallacticAngle: pa,
|
|
154
|
-
};
|
|
155
|
-
};
|
|
156
|
-
/**
|
|
157
|
-
* calculations for moon rise/set times are based on http://www.stargazing.net/kepler/moonrise.html article
|
|
158
|
-
* @param {number|Date} dateValue Date object or timestamp for calculating moon-times
|
|
159
|
-
* @param {Degrees} lat latitude for calculating moon-times
|
|
160
|
-
* @param {Degrees} lon longitude for calculating moon-times
|
|
161
|
-
* @param {boolean} [isUtc] defines if the calculation should be in utc or local time (default is local)
|
|
162
|
-
* @return {IMoonTimes} result object of sunTime
|
|
163
|
-
*/
|
|
164
|
-
MoonMath.getMoonTimes = function (dateValue, lat, lon, isUtc) {
|
|
165
|
-
if (isUtc === void 0) { isUtc = false; }
|
|
166
|
-
var t = new Date(dateValue);
|
|
167
|
-
if (isUtc) {
|
|
168
|
-
t.setUTCHours(0, 0, 0, 0);
|
|
169
|
-
}
|
|
170
|
-
else {
|
|
171
|
-
t.setHours(0, 0, 0, 0);
|
|
172
|
-
}
|
|
173
|
-
var _a = MoonMath.calculateRiseSetTimes_(t, lat, lon), rise = _a.rise, set = _a.set, ye = _a.ye;
|
|
174
|
-
var result = {
|
|
175
|
-
rise: null,
|
|
176
|
-
set: null,
|
|
177
|
-
ye: null,
|
|
178
|
-
alwaysUp: null,
|
|
179
|
-
alwaysDown: null,
|
|
180
|
-
highest: null,
|
|
181
|
-
};
|
|
182
|
-
if (rise) {
|
|
183
|
-
result.rise = new Date(MoonMath.hoursLater(t, rise));
|
|
184
|
-
}
|
|
185
|
-
else {
|
|
186
|
-
result.rise = NaN;
|
|
187
|
-
}
|
|
188
|
-
if (set) {
|
|
189
|
-
result.set = new Date(MoonMath.hoursLater(t, set));
|
|
190
|
-
}
|
|
191
|
-
else {
|
|
192
|
-
result.set = NaN;
|
|
193
|
-
}
|
|
194
|
-
if (!rise && !set) {
|
|
195
|
-
if (ye > 0) {
|
|
196
|
-
result.alwaysUp = true;
|
|
197
|
-
result.alwaysDown = false;
|
|
198
|
-
}
|
|
199
|
-
else {
|
|
200
|
-
result.alwaysUp = false;
|
|
201
|
-
result.alwaysDown = true;
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
else if (rise && set) {
|
|
205
|
-
result.alwaysUp = false;
|
|
206
|
-
result.alwaysDown = false;
|
|
207
|
-
result.highest = new Date(MoonMath.hoursLater(t, Math.min(rise, set) + Math.abs(set - rise) / 2));
|
|
208
|
-
}
|
|
209
|
-
else {
|
|
210
|
-
result.alwaysUp = false;
|
|
211
|
-
result.alwaysDown = false;
|
|
212
|
-
}
|
|
213
|
-
return result;
|
|
214
|
-
};
|
|
215
|
-
MoonMath.hoursLater = function (date, h) {
|
|
216
|
-
return new Date(date.getTime() + (h * MS_PER_DAY) / 24);
|
|
217
|
-
};
|
|
218
|
-
MoonMath.moonCoords = function (d) {
|
|
219
|
-
// geocentric ecliptic coordinates of the moon
|
|
220
|
-
var L = DEG2RAD * (218.316 + 13.176396 * d); // ecliptic longitude
|
|
221
|
-
var M = DEG2RAD * (134.963 + 13.064993 * d); // mean anomaly
|
|
222
|
-
var F = DEG2RAD * (93.272 + 13.22935 * d); // mean distance
|
|
223
|
-
var l = L + DEG2RAD * 6.289 * Math.sin(M); // longitude
|
|
224
|
-
var b = DEG2RAD * 5.128 * Math.sin(F); // latitude
|
|
225
|
-
var dt = 385001 - 20905 * Math.cos(M); // distance to the moon in km
|
|
226
|
-
return {
|
|
227
|
-
ra: SunMath.rightAscension(l, b),
|
|
228
|
-
dec: SunMath.declination(l, b),
|
|
229
|
-
dist: dt,
|
|
230
|
-
};
|
|
231
|
-
};
|
|
232
|
-
// eslint-disable-next-line max-statements
|
|
233
|
-
MoonMath.calculateRiseSetTimes_ = function (t, lat, lon) {
|
|
234
|
-
var hc = 0.133 * DEG2RAD;
|
|
235
|
-
var h0 = MoonMath.getMoonPosition(t, lat, lon).el - hc;
|
|
236
|
-
var h1 = 0;
|
|
237
|
-
var h2 = 0;
|
|
238
|
-
var rise = 0;
|
|
239
|
-
var set = 0;
|
|
240
|
-
var a = 0;
|
|
241
|
-
var b = 0;
|
|
242
|
-
var xe = 0;
|
|
243
|
-
var ye = 0;
|
|
244
|
-
var d = 0;
|
|
245
|
-
var roots = 0;
|
|
246
|
-
var x1 = 0;
|
|
247
|
-
var x2 = 0;
|
|
248
|
-
var dx = 0;
|
|
249
|
-
// go in 2-hour chunks, each time seeing if a 3-point quadratic curve crosses zero (which means rise or set)
|
|
250
|
-
for (var i = 1; i <= 24; i += 2) {
|
|
251
|
-
h1 = MoonMath.getMoonPosition(MoonMath.hoursLater(t, i), lat, lon).el - hc;
|
|
252
|
-
h2 = MoonMath.getMoonPosition(MoonMath.hoursLater(t, i + 1), lat, lon).el - hc;
|
|
253
|
-
a = (h0 + h2) / 2 - h1;
|
|
254
|
-
b = (h2 - h0) / 2;
|
|
255
|
-
xe = -b / (2 * a);
|
|
256
|
-
ye = (a * xe + b) * xe + h1;
|
|
257
|
-
d = b * b - 4 * a * h1;
|
|
258
|
-
roots = 0;
|
|
259
|
-
if (d >= 0) {
|
|
260
|
-
dx = Math.sqrt(d) / (Math.abs(a) * 2);
|
|
261
|
-
x1 = xe - dx;
|
|
262
|
-
x2 = xe + dx;
|
|
263
|
-
if (Math.abs(x1) <= 1) {
|
|
264
|
-
roots++;
|
|
265
|
-
}
|
|
266
|
-
if (Math.abs(x2) <= 1) {
|
|
267
|
-
roots++;
|
|
268
|
-
}
|
|
269
|
-
if (x1 < -1) {
|
|
270
|
-
x1 = x2;
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
if (roots === 1) {
|
|
274
|
-
if (h0 < 0) {
|
|
275
|
-
rise = i + x1;
|
|
276
|
-
}
|
|
277
|
-
else {
|
|
278
|
-
set = i + x1;
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
else if (roots === 2) {
|
|
282
|
-
rise = i + (ye < 0 ? x2 : x1);
|
|
283
|
-
set = i + (ye < 0 ? x1 : x2);
|
|
284
|
-
}
|
|
285
|
-
if (rise && set) {
|
|
286
|
-
break;
|
|
287
|
-
}
|
|
288
|
-
h0 = h2;
|
|
289
|
-
}
|
|
290
|
-
return { rise: rise, set: set, ye: ye };
|
|
291
|
-
};
|
|
292
|
-
MoonMath.moonCycles_ = [
|
|
293
|
-
{
|
|
294
|
-
from: 0,
|
|
295
|
-
to: 0.033863193308711,
|
|
296
|
-
id: 'newMoon',
|
|
297
|
-
emoji: '🌚',
|
|
298
|
-
code: ':new_moon_with_face:',
|
|
299
|
-
name: 'New Moon',
|
|
300
|
-
weight: 1,
|
|
301
|
-
css: 'wi-moon-new',
|
|
302
|
-
},
|
|
303
|
-
{
|
|
304
|
-
from: 0.033863193308711,
|
|
305
|
-
to: 0.216136806691289,
|
|
306
|
-
id: 'waxingCrescentMoon',
|
|
307
|
-
emoji: '🌒',
|
|
308
|
-
code: ':waxing_crescent_moon:',
|
|
309
|
-
name: 'Waxing Crescent',
|
|
310
|
-
weight: 6.3825,
|
|
311
|
-
css: 'wi-moon-wax-cres',
|
|
312
|
-
},
|
|
313
|
-
{
|
|
314
|
-
from: 0.216136806691289,
|
|
315
|
-
to: 0.283863193308711,
|
|
316
|
-
id: 'firstQuarterMoon',
|
|
317
|
-
emoji: '🌓',
|
|
318
|
-
code: ':first_quarter_moon:',
|
|
319
|
-
name: 'First Quarter',
|
|
320
|
-
weight: 1,
|
|
321
|
-
css: 'wi-moon-first-quart',
|
|
322
|
-
},
|
|
323
|
-
{
|
|
324
|
-
from: 0.283863193308711,
|
|
325
|
-
to: 0.466136806691289,
|
|
326
|
-
id: 'waxingGibbousMoon',
|
|
327
|
-
emoji: '🌔',
|
|
328
|
-
code: ':waxing_gibbous_moon:',
|
|
329
|
-
name: 'Waxing Gibbous',
|
|
330
|
-
weight: 6.3825,
|
|
331
|
-
css: 'wi-moon-wax-gibb',
|
|
332
|
-
},
|
|
333
|
-
{
|
|
334
|
-
from: 0.466136806691289,
|
|
335
|
-
to: 0.533863193308711,
|
|
336
|
-
id: 'fullMoon',
|
|
337
|
-
emoji: '🌝',
|
|
338
|
-
code: ':full_moon_with_face:',
|
|
339
|
-
name: 'Full Moon',
|
|
340
|
-
weight: 1,
|
|
341
|
-
css: 'wi-moon-full',
|
|
342
|
-
},
|
|
343
|
-
{
|
|
344
|
-
from: 0.533863193308711,
|
|
345
|
-
to: 0.716136806691289,
|
|
346
|
-
id: 'waningGibbousMoon',
|
|
347
|
-
emoji: '🌖',
|
|
348
|
-
code: ':waning_gibbous_moon:',
|
|
349
|
-
name: 'Waning Gibbous',
|
|
350
|
-
weight: 6.3825,
|
|
351
|
-
css: 'wi-moon-wan-gibb',
|
|
352
|
-
},
|
|
353
|
-
{
|
|
354
|
-
from: 0.716136806691289,
|
|
355
|
-
to: 0.783863193308711,
|
|
356
|
-
id: 'thirdQuarterMoon',
|
|
357
|
-
emoji: '🌗',
|
|
358
|
-
code: ':last_quarter_moon:',
|
|
359
|
-
name: 'third Quarter',
|
|
360
|
-
weight: 1,
|
|
361
|
-
css: 'wi-moon-third-quart',
|
|
362
|
-
},
|
|
363
|
-
{
|
|
364
|
-
from: 0.783863193308711,
|
|
365
|
-
to: 0.966136806691289,
|
|
366
|
-
id: 'waningCrescentMoon',
|
|
367
|
-
emoji: '🌘',
|
|
368
|
-
code: ':waning_crescent_moon:',
|
|
369
|
-
name: 'Waning Crescent',
|
|
370
|
-
weight: 6.3825,
|
|
371
|
-
css: 'wi-moon-wan-cres',
|
|
372
|
-
},
|
|
373
|
-
{
|
|
374
|
-
from: 0.966136806691289,
|
|
375
|
-
to: 1,
|
|
376
|
-
id: 'newMoon',
|
|
377
|
-
emoji: '🌚',
|
|
378
|
-
code: ':new_moon_with_face:',
|
|
379
|
-
name: 'New Moon',
|
|
380
|
-
weight: 1,
|
|
381
|
-
css: 'wi-moon-new',
|
|
382
|
-
},
|
|
383
|
-
];
|
|
384
|
-
return MoonMath;
|
|
385
|
-
}());
|
|
386
|
-
export { MoonMath };
|
|
387
|
-
//# sourceMappingURL=moon-math.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"moon-math.js","sourceRoot":"","sources":["../../src/utils/moon-math.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,OAA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ACX,IAAI,EAAE,qBAAqB;YAC3B,IAAI,EAAE,eAAe;YACrB,MAAM,EAAE,CAAC;YACT,GAAG,EAAE,qBAAqB;SAC3B;QACD;YACE,IAAI,EAAE,iBAAiB;YACvB,EAAE,EAAE,iBAAiB;YACrB,EAAE,EAAE,oBAAoB;YACxB,KAAK,EAAE,IAAI;YACX,IAAI,EAAE,wBAAwB;YAC9B,IAAI,EAAE,iBAAiB;YACvB,MAAM,EAAE,MAAM;YACd,GAAG,EAAE,kBAAkB;SACxB;QACD;YACE,IAAI,EAAE,iBAAiB;YACvB,EAAE,EAAE,CAAC;YACL,EAAE,EAAE,SAAS;YACb,KAAK,EAAE,IAAI;YACX,IAAI,EAAE,sBAAsB;YAC5B,IAAI,EAAE,UAAU;YAChB,MAAM,EAAE,CAAC;YACT,GAAG,EAAE,aAAa;SACnB;KACF,CAAC;IAuRJ,eAAC;CAAA,AAnXD,IAmXC;SAnXY,QAAQ"}
|
package/lib/utils/sun-math.d.ts
DELETED
|
@@ -1,230 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author Theodore Kruczek.
|
|
3
|
-
* @description Orbital Object ToolKit (OOTK) is a collection of tools for working
|
|
4
|
-
* with satellites and other orbital objects.
|
|
5
|
-
*
|
|
6
|
-
* @file SunMath is a collection of functions for calculating the position of the sun
|
|
7
|
-
* and other stars. This was originally created by Vladimir Agafonkin. Robert Gester's
|
|
8
|
-
* update was referenced for documentation. There were a couple of bugs in both versions
|
|
9
|
-
* so there will be some differences if you are migrating from either to this library.
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* @license AGPL-3.0-or-later
|
|
13
|
-
* @Copyright (c) 2020-2023 Theodore Kruczek
|
|
14
|
-
*
|
|
15
|
-
* @Copyright (c) 2011-2015, Vladimir Agafonkin
|
|
16
|
-
* SunCalc is a JavaScript library for calculating sun/moon position and light phases.
|
|
17
|
-
* https://github.com/mourner/suncalc
|
|
18
|
-
*
|
|
19
|
-
* Reworked and enhanced by Robert Gester
|
|
20
|
-
* @Copyright (c) 2022 Robert Gester
|
|
21
|
-
* https://github.com/hypnos3/suncalc3
|
|
22
|
-
*
|
|
23
|
-
* sun calculations are based on http://aa.quae.nl/en/reken/zonpositie.html formulas
|
|
24
|
-
*
|
|
25
|
-
* Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
|
|
26
|
-
* terms of the GNU Affero General Public License as published by the Free Software
|
|
27
|
-
* Foundation, either version 3 of the License, or (at your option) any later version.
|
|
28
|
-
*
|
|
29
|
-
* Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
30
|
-
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
31
|
-
* See the GNU Affero General Public License for more details.
|
|
32
|
-
*
|
|
33
|
-
* You should have received a copy of the GNU Affero General Public License along with
|
|
34
|
-
* Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
|
|
35
|
-
*/
|
|
36
|
-
import { Degrees, Radians } from '../ootk';
|
|
37
|
-
import { AzEl, Meters, SunTime } from '../types/types';
|
|
38
|
-
export declare class SunMath {
|
|
39
|
-
private static readonly J0_;
|
|
40
|
-
private static readonly J1970_;
|
|
41
|
-
private static readonly J2000_;
|
|
42
|
-
private static readonly e_;
|
|
43
|
-
private static times_;
|
|
44
|
-
/**
|
|
45
|
-
* approx transit
|
|
46
|
-
* @param {number} Ht - hourAngle
|
|
47
|
-
* @param {number} lw - rad * -lng
|
|
48
|
-
* @param {number} n - Julian cycle
|
|
49
|
-
* @returns {number} approx transit
|
|
50
|
-
*/
|
|
51
|
-
static approxTransit(Ht: number, lw: number, n: number): number;
|
|
52
|
-
/**
|
|
53
|
-
* get astro refraction
|
|
54
|
-
* @param {Radians} h - elevation
|
|
55
|
-
* @returns {number} refraction
|
|
56
|
-
*/
|
|
57
|
-
static astroRefraction(h: Radians): Radians;
|
|
58
|
-
/**
|
|
59
|
-
* get azimuth
|
|
60
|
-
* @param {number} H - siderealTime
|
|
61
|
-
* @param {Radians} phi - latitude
|
|
62
|
-
* @param {Radians} dec - The declination of the sun
|
|
63
|
-
* @returns {Radians} azimuth in rad
|
|
64
|
-
*/
|
|
65
|
-
static azimuth(H: number, phi: Radians, dec: Radians): Radians;
|
|
66
|
-
/**
|
|
67
|
-
* get number of days for a dateValue since 2000
|
|
68
|
-
*
|
|
69
|
-
* See: https://en.wikipedia.org/wiki/Epoch_(astronomy)
|
|
70
|
-
*
|
|
71
|
-
* @param {number} date date as timestamp to get days
|
|
72
|
-
* @return {number} count of days
|
|
73
|
-
*/
|
|
74
|
-
static date2jSince2000(date: Date): number;
|
|
75
|
-
/**
|
|
76
|
-
* get declination
|
|
77
|
-
* @param {number} l - ecliptic longitude
|
|
78
|
-
* @param {number} b - ecliptic latitude
|
|
79
|
-
* @returns {number} declination
|
|
80
|
-
*/
|
|
81
|
-
static declination(l: number, b: number): Radians;
|
|
82
|
-
/**
|
|
83
|
-
* ecliptic latitude
|
|
84
|
-
* @param {number} B - ?
|
|
85
|
-
* @returns {number} ecliptic latitude
|
|
86
|
-
*/
|
|
87
|
-
static eclipticLatitude(B: number): number;
|
|
88
|
-
/**
|
|
89
|
-
* ecliptic longitude
|
|
90
|
-
* @param {number} M - solar mean anomaly
|
|
91
|
-
* @returns {number} ecliptic longitude
|
|
92
|
-
*/
|
|
93
|
-
static eclipticLongitude(M: number): Radians;
|
|
94
|
-
/**
|
|
95
|
-
* get elevation (sometimes called altitude)
|
|
96
|
-
* @param {number} H - siderealTime
|
|
97
|
-
* @param {Radians} phi - latitude
|
|
98
|
-
* @param {Radians} dec - The declination of the sun
|
|
99
|
-
* @returns {Radians} elevation
|
|
100
|
-
*/
|
|
101
|
-
static elevation(H: number, phi: Radians, dec: Radians): Radians;
|
|
102
|
-
/**
|
|
103
|
-
* returns set time for the given sun altitude
|
|
104
|
-
* @param {number} h - heigh at 0
|
|
105
|
-
* @param {number} lw - rad * -lng
|
|
106
|
-
* @param {number} phi - rad * lat;
|
|
107
|
-
* @param {number} dec - declination
|
|
108
|
-
* @param {number} n - Julian cycle
|
|
109
|
-
* @param {number} M - solar mean anomal
|
|
110
|
-
* @param {number} L - ecliptic longitude
|
|
111
|
-
* @returns {number} set time
|
|
112
|
-
*/
|
|
113
|
-
static getSetJulian(h: Meters, lw: number, phi: number, dec: number, n: number, M: number, L: number): number;
|
|
114
|
-
/**
|
|
115
|
-
* Convert Date to Solar Date/Time
|
|
116
|
-
*
|
|
117
|
-
* Based on https://www.pveducation.org/pvcdrom/properties-of-sunlight/solar-time
|
|
118
|
-
*
|
|
119
|
-
* See: https://github.com/mourner/suncalc/pull/156
|
|
120
|
-
*
|
|
121
|
-
* @param {date} date - Date to calculate for
|
|
122
|
-
* @param {number} utcOffset - UTC offset in hours
|
|
123
|
-
* @param {Degrees} lon - Longitude in degrees
|
|
124
|
-
* @returns {Date} - Date Object in Solar Time
|
|
125
|
-
*/
|
|
126
|
-
static getSolarTime(date: Date, utcOffset: number, lon: number): Date;
|
|
127
|
-
static getStarAzEl(date: Date, lat: Degrees, lon: Degrees, ra: Radians, dec: Radians): AzEl;
|
|
128
|
-
static getSunAzEl(date: Date, lat: Degrees, lon: Degrees): AzEl;
|
|
129
|
-
static getSunRaDec(d: number): {
|
|
130
|
-
dec: Radians;
|
|
131
|
-
ra: Radians;
|
|
132
|
-
};
|
|
133
|
-
/**
|
|
134
|
-
* calculates time for a given azimuth angle for a given date and latitude/longitude
|
|
135
|
-
* @param {number|Date} dateValue Date object or timestamp for calculating sun-time
|
|
136
|
-
* @param {Degrees} lat latitude for calculating sun-time
|
|
137
|
-
* @param {Degrees} lon longitude for calculating sun-time
|
|
138
|
-
* @param {Radians | Degrees} az azimuth for calculating sun-time
|
|
139
|
-
* @param {boolean} [isDegrees] true if the az angle is in degree and not in rad
|
|
140
|
-
* @return {Date} result time of sun-time
|
|
141
|
-
*/
|
|
142
|
-
static getSunTimeByAzimuth(dateValue: any, lat: Degrees, lon: Degrees, az: Radians | Degrees, isDegrees?: boolean): Date;
|
|
143
|
-
/**
|
|
144
|
-
* calculates sun times for a given date and latitude/longitude
|
|
145
|
-
* @param {Date|number} dateVal Date object for calculating sun-times
|
|
146
|
-
* @param {number} lat latitude for calculating sun-times
|
|
147
|
-
* @param {number} lon longitude for calculating sun-times
|
|
148
|
-
* @param {number} [alt=0] the observer height (in meters) relative to the horizon
|
|
149
|
-
* @param {boolean} [isUtc=false] defines if the calculation should be in utc or local time (default is local)
|
|
150
|
-
* @return {SunTime} result object of sunTime
|
|
151
|
-
*/
|
|
152
|
-
static getTimes(dateVal: Date, lat: Degrees, lon: Degrees, alt?: Meters, isUtc?: boolean): SunTime;
|
|
153
|
-
/**
|
|
154
|
-
* hour angle
|
|
155
|
-
* @param {number} h - heigh at 0
|
|
156
|
-
* @param {number} phi - rad * lat;
|
|
157
|
-
* @param {number} dec - declination
|
|
158
|
-
* @returns {number} hour angle
|
|
159
|
-
*/
|
|
160
|
-
static hourAngle(h: number, phi: number, dec: number): number;
|
|
161
|
-
/**
|
|
162
|
-
* convert Julian calendar to date object
|
|
163
|
-
* @param {number} julian day number in Julian calendar to convert
|
|
164
|
-
* @return {number} result date as timestamp
|
|
165
|
-
*/
|
|
166
|
-
static julian2date(julian: number): Date;
|
|
167
|
-
/**
|
|
168
|
-
* Julian cycle
|
|
169
|
-
* @param {number} d - number of days
|
|
170
|
-
* @param {number} lw - rad * -lng;
|
|
171
|
-
* @returns {number} julian cycle
|
|
172
|
-
*/
|
|
173
|
-
static julianCyle(d: number, lw: number): number;
|
|
174
|
-
/**
|
|
175
|
-
* get right ascension
|
|
176
|
-
* @param {number} l - ecliptic longitude
|
|
177
|
-
* @param {number} b - ecliptic latitude
|
|
178
|
-
* @returns {number} right ascension
|
|
179
|
-
*/
|
|
180
|
-
static rightAscension(l: number, b: number): Radians;
|
|
181
|
-
/**
|
|
182
|
-
* side real time
|
|
183
|
-
* @param {number} d - julian day
|
|
184
|
-
* @param {Radians} lw - longitude of the observer
|
|
185
|
-
* @returns {number} sidereal time
|
|
186
|
-
*/
|
|
187
|
-
static siderealTime(d: number, lw: Radians): number;
|
|
188
|
-
/**
|
|
189
|
-
* solar transit in Julian
|
|
190
|
-
* @param {number} ds - approxTransit
|
|
191
|
-
* @param {number} M - solar mean anomal
|
|
192
|
-
* @param {number} L - ecliptic longitude
|
|
193
|
-
* @returns {number} solar transit in Julian
|
|
194
|
-
*/
|
|
195
|
-
static solarTransitJulian(ds: number, M: number, L: number): number;
|
|
196
|
-
private static calculateJnoon_;
|
|
197
|
-
/**
|
|
198
|
-
* get azimuth
|
|
199
|
-
* @param {number} H - siderealTime
|
|
200
|
-
* @param {Radians} phi - latitude
|
|
201
|
-
* @param {Radians} dec - The declination of the sun
|
|
202
|
-
* @returns {Radians} azimuth
|
|
203
|
-
*/
|
|
204
|
-
private static getAzimuth_;
|
|
205
|
-
/**
|
|
206
|
-
* returns set time for the given sun altitude
|
|
207
|
-
* @param {Meters} alt - altitude at 0
|
|
208
|
-
* @param {Radians} lw - -lng
|
|
209
|
-
* @param {Radians} phi - lat;
|
|
210
|
-
* @param {Radians} dec - declination
|
|
211
|
-
* @param {number} n - Julian cycle
|
|
212
|
-
* @param {number} M - solar mean anomal
|
|
213
|
-
* @param {number} L - ecliptic longitude
|
|
214
|
-
* @return {J2000Value} sunset time in days since 2000
|
|
215
|
-
*/
|
|
216
|
-
private static getSetJ_;
|
|
217
|
-
private static julianCycle_;
|
|
218
|
-
/**
|
|
219
|
-
* calculates the obderver angle
|
|
220
|
-
* @param {number} alt the observer altitude (in meters) relative to the horizon
|
|
221
|
-
* @returns {Degrees} height for further calculations
|
|
222
|
-
*/
|
|
223
|
-
private static observerAngle_;
|
|
224
|
-
/**
|
|
225
|
-
* get solar mean anomaly
|
|
226
|
-
* @param {number} d - julian day
|
|
227
|
-
* @returns {number} solar mean anomaly
|
|
228
|
-
*/
|
|
229
|
-
private static solarMeanAnomaly_;
|
|
230
|
-
}
|