-
Notifications
You must be signed in to change notification settings - Fork 63
/
astronomy.d.ts
3441 lines (3435 loc) · 153 KB
/
astronomy.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/**
@preserve
Astronomy library for JavaScript (browser and Node.js).
https://github.com/cosinekitty/astronomy
MIT License
Copyright (c) 2019-2024 Don Cross <cosinekitty@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
export declare type FlexibleDateTime = Date | number | AstroTime;
/**
* @brief The speed of light in AU/day.
*/
export declare const C_AUDAY = 173.1446326846693;
/**
* @brief The number of kilometers per astronomical unit.
*/
export declare const KM_PER_AU = 149597870.69098932;
/**
* @brief The number of astronomical units per light-year.
*/
export declare const AU_PER_LY = 63241.07708807546;
/**
* @brief The factor to convert degrees to radians = pi/180.
*/
export declare const DEG2RAD = 0.017453292519943295;
/**
* @brief The factor to convert sidereal hours to radians = pi/12.
*/
export declare const HOUR2RAD = 0.26179938779914946;
/**
* @brief The factor to convert radians to degrees = 180/pi.
*/
export declare const RAD2DEG = 57.29577951308232;
/**
* @brief The factor to convert radians to sidereal hours = 12/pi.
*/
export declare const RAD2HOUR = 3.819718634205488;
/**
* @brief The equatorial radius of Jupiter, expressed in kilometers.
*/
export declare const JUPITER_EQUATORIAL_RADIUS_KM = 71492;
/**
* @brief The polar radius of Jupiter, expressed in kilometers.
*/
export declare const JUPITER_POLAR_RADIUS_KM = 66854;
/**
* @brief The volumetric mean radius of Jupiter, expressed in kilometers.
*/
export declare const JUPITER_MEAN_RADIUS_KM = 69911;
/**
* @brief The mean radius of Jupiter's moon Io, expressed in kilometers.
*/
export declare const IO_RADIUS_KM = 1821.6;
/**
* @brief The mean radius of Jupiter's moon Europa, expressed in kilometers.
*/
export declare const EUROPA_RADIUS_KM = 1560.8;
/**
* @brief The mean radius of Jupiter's moon Ganymede, expressed in kilometers.
*/
export declare const GANYMEDE_RADIUS_KM = 2631.2;
/**
* @brief The mean radius of Jupiter's moon Callisto, expressed in kilometers.
*/
export declare const CALLISTO_RADIUS_KM = 2410.3;
/**
* @brief Returns the product of mass and universal gravitational constant of a Solar System body.
*
* For problems involving the gravitational interactions of Solar System bodies,
* it is helpful to know the product GM, where G = the universal gravitational constant
* and M = the mass of the body. In practice, GM is known to a higher precision than
* either G or M alone, and thus using the product results in the most accurate results.
* This function returns the product GM in the units au^3/day^2.
* The values come from page 10 of a
* [JPL memorandum regarding the DE405/LE405 ephemeris](https://web.archive.org/web/20120220062549/http://iau-comm4.jpl.nasa.gov/de405iom/de405iom.pdf).
*
* @param {Body} body
* The body for which to find the GM product.
* Allowed to be the Sun, Moon, EMB (Earth/Moon Barycenter), or any planet.
* Any other value will cause an exception to be thrown.
*
* @returns {number}
* The mass product of the given body in au^3/day^2.
*/
export declare function MassProduct(body: Body): number;
/**
* @brief Calculates the angle in degrees between two vectors.
*
* Given a pair of vectors, this function returns the angle in degrees
* between the two vectors in 3D space.
* The angle is measured in the plane that contains both vectors.
*
* @param {Vector} a
* The first of a pair of vectors between which to measure an angle.
*
* @param {Vector} b
* The second of a pair of vectors between which to measure an angle.
*
* @returns {number}
* The angle between the two vectors expressed in degrees.
* The value is in the range [0, 180].
*/
export declare function AngleBetween(a: Vector, b: Vector): number;
/**
* @brief String constants that represent the solar system bodies supported by Astronomy Engine.
*
* The following strings represent solar system bodies supported by various Astronomy Engine functions.
* Not every body is supported by every function; consult the documentation for each function
* to find which bodies it supports.
*
* "Sun", "Moon", "Mercury", "Venus", "Earth", "Mars", "Jupiter",
* "Saturn", "Uranus", "Neptune", "Pluto",
* "SSB" (Solar System Barycenter),
* "EMB" (Earth/Moon Barycenter)
*
* You can also use enumeration syntax for the bodies, like
* `Astronomy.Body.Moon`, `Astronomy.Body.Jupiter`, etc.
*
* @enum {string}
*/
export declare enum Body {
Sun = "Sun",
Moon = "Moon",
Mercury = "Mercury",
Venus = "Venus",
Earth = "Earth",
Mars = "Mars",
Jupiter = "Jupiter",
Saturn = "Saturn",
Uranus = "Uranus",
Neptune = "Neptune",
Pluto = "Pluto",
SSB = "SSB",
EMB = "EMB",
Star1 = "Star1",
Star2 = "Star2",
Star3 = "Star3",
Star4 = "Star4",
Star5 = "Star5",
Star6 = "Star6",
Star7 = "Star7",
Star8 = "Star8"
}
/**
* @brief Assign equatorial coordinates to a user-defined star.
*
* Some Astronomy Engine functions allow their `body` parameter to
* be a user-defined fixed point in the sky, loosely called a "star".
* This function assigns a right ascension, declination, and distance
* to one of the eight user-defined stars `Star1`..`Star8`.
*
* Stars are not valid until defined. Once defined, they retain their
* definition until re-defined by another call to `DefineStar`.
*
* @param {Body} body
* One of the eight user-defined star identifiers:
* `Star1`, `Star2`, `Star3`, `Star4`, `Star5`, `Star6`, `Star7`, or `Star8`.
*
* @param {number} ra
* The right ascension to be assigned to the star, expressed in J2000 equatorial coordinates (EQJ).
* The value is in units of sidereal hours, and must be within the half-open range [0, 24).
*
* @param {number} dec
* The declination to be assigned to the star, expressed in J2000 equatorial coordinates (EQJ).
* The value is in units of degrees north (positive) or south (negative) of the J2000 equator,
* and must be within the closed range [-90, +90].
*
* @param {number} distanceLightYears
* The distance between the star and the Sun, expressed in light-years.
* This value is used to calculate the tiny parallax shift as seen by an observer on Earth.
* If you don't know the distance to the star, using a large value like 1000 will generally work well.
* The minimum allowed distance is 1 light-year, which is required to provide certain internal optimizations.
*/
export declare function DefineStar(body: Body, ra: number, dec: number, distanceLightYears: number): void;
/**
* @brief Returns the mean orbital period of a planet in days.
*
* @param {Body} body
* One of: Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, Neptune, or Pluto.
*
* @returns {number}
* The approximate average time it takes for the planet to travel once around the Sun.
* The value is expressed in days.
*/
export declare function PlanetOrbitalPeriod(body: Body): number;
export declare function DeltaT_EspenakMeeus(ut: number): number;
export declare type DeltaTimeFunction = (ut: number) => number;
export declare function DeltaT_JplHorizons(ut: number): number;
export declare function SetDeltaTFunction(func: DeltaTimeFunction): void;
/**
* @brief The date and time of an astronomical observation.
*
* Objects of type `AstroTime` are used throughout the internals
* of the Astronomy library, and are included in certain return objects.
* Use the constructor or the {@link MakeTime} function to create an `AstroTime` object.
*
* @property {Date} date
* The JavaScript Date object for the given date and time.
* This Date corresponds to the numeric day value stored in the `ut` property.
*
* @property {number} ut
* Universal Time (UT1/UTC) in fractional days since the J2000 epoch.
* Universal Time represents time measured with respect to the Earth's rotation,
* tracking mean solar days.
* The Astronomy library approximates UT1 and UTC as being the same thing.
* This gives sufficient accuracy for the precision requirements of this project.
*
* @property {number} tt
* Terrestrial Time in fractional days since the J2000 epoch.
* TT represents a continuously flowing ephemeris timescale independent of
* any variations of the Earth's rotation, and is adjusted from UT
* using a best-fit piecewise polynomial model devised by
* [Espenak and Meeus](https://eclipse.gsfc.nasa.gov/SEhelp/deltatpoly2004.html).
*/
export declare class AstroTime {
date: Date;
ut: number;
tt: number;
/**
* @param {FlexibleDateTime} date
* A JavaScript Date object, a numeric UTC value expressed in J2000 days, or another AstroTime object.
*/
constructor(date: FlexibleDateTime);
/**
* @brief Creates an `AstroTime` value from a Terrestrial Time (TT) day value.
*
* This function can be used in rare cases where a time must be based
* on Terrestrial Time (TT) rather than Universal Time (UT).
* Most developers will want to invoke `new AstroTime(ut)` with a universal time
* instead of this function, because usually time is based on civil time adjusted
* by leap seconds to match the Earth's rotation, rather than the uniformly
* flowing TT used to calculate solar system dynamics. In rare cases
* where the caller already knows TT, this function is provided to create
* an `AstroTime` value that can be passed to Astronomy Engine functions.
*
* @param {number} tt
* The number of days since the J2000 epoch as expressed in Terrestrial Time.
*
* @returns {AstroTime}
* An `AstroTime` object for the specified terrestrial time.
*/
static FromTerrestrialTime(tt: number): AstroTime;
/**
* Formats an `AstroTime` object as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)
* date/time string in UTC, to millisecond resolution.
* Example: `2018-08-17T17:22:04.050Z`
* @returns {string}
*/
toString(): string;
/**
* Returns a new `AstroTime` object adjusted by the floating point number of days.
* Does NOT modify the original `AstroTime` object.
*
* @param {number} days
* The floating point number of days by which to adjust the given date and time.
* Positive values adjust the date toward the future, and
* negative values adjust the date toward the past.
*
* @returns {AstroTime}
*/
AddDays(days: number): AstroTime;
}
/**
* @brief A `Date`, `number`, or `AstroTime` value that specifies the date and time of an astronomical event.
*
* `FlexibleDateTime` is a placeholder type that represents three different types
* that may be passed to many Astronomy Engine functions: a JavaScript `Date` object,
* a number representing the real-valued number of UT days since the J2000 epoch,
* or an {@link AstroTime} object.
*
* This flexibility is for convenience of outside callers.
* Internally, Astronomy Engine always converts a `FlexibleDateTime` parameter
* to an `AstroTime` object by calling {@link MakeTime}.
*
* @typedef {Date | number | AstroTime} FlexibleDateTime
*/
/**
* @brief Converts multiple date/time formats to `AstroTime` format.
*
* Given a Date object or a number days since noon (12:00) on January 1, 2000 (UTC),
* this function creates an {@link AstroTime} object.
*
* Given an {@link AstroTime} object, returns the same object unmodified.
* Use of this function is not required for any of the other exposed functions in this library,
* because they all guarantee converting date/time parameters to `AstroTime`
* as needed. However, it may be convenient for callers who need to understand
* the difference between UTC and TT (Terrestrial Time). In some use cases,
* converting once to `AstroTime` format and passing the result into multiple
* function calls may be more efficient than passing in native JavaScript Date objects.
*
* @param {FlexibleDateTime} date
* A Date object, a number of UTC days since the J2000 epoch (noon on January 1, 2000),
* or an AstroTime object. See remarks above.
*
* @returns {AstroTime}
*/
export declare function MakeTime(date: FlexibleDateTime): AstroTime;
export interface EarthTiltInfo {
tt: number;
dpsi: number;
deps: number;
ee: number;
mobl: number;
tobl: number;
}
export declare function e_tilt(time: AstroTime): EarthTiltInfo;
export declare let CalcMoonCount: number;
/**
* @brief Lunar libration angles, returned by {@link Libration}.
*
* @property {number} elat
* Sub-Earth libration ecliptic latitude angle, in degrees.
* @property {number} elon
* Sub-Earth libration ecliptic longitude angle, in degrees.
* @property {number} mlat
* Moon's geocentric ecliptic latitude, in degrees.
* @property {number} mlon
* Moon's geocentric ecliptic longitude, in degrees.
* @property {number} dist_km
* Distance between the centers of the Earth and Moon in kilometers.
* @property {number} diam_deg
* The apparent angular diameter of the Moon, in degrees, as seen from the center of the Earth.
*/
export declare class LibrationInfo {
elat: number;
elon: number;
mlat: number;
mlon: number;
dist_km: number;
diam_deg: number;
constructor(elat: number, elon: number, mlat: number, mlon: number, dist_km: number, diam_deg: number);
}
/**
* @brief Calculates the Moon's libration angles at a given moment in time.
*
* Libration is an observed back-and-forth wobble of the portion of the
* Moon visible from the Earth. It is caused by the imperfect tidal locking
* of the Moon's fixed rotation rate, compared to its variable angular speed
* of orbit around the Earth.
*
* This function calculates a pair of perpendicular libration angles,
* one representing rotation of the Moon in ecliptic longitude `elon`, the other
* in ecliptic latitude `elat`, both relative to the Moon's mean Earth-facing position.
*
* This function also returns the geocentric position of the Moon
* expressed in ecliptic longitude `mlon`, ecliptic latitude `mlat`, the
* distance `dist_km` between the centers of the Earth and Moon expressed in kilometers,
* and the apparent angular diameter of the Moon `diam_deg`.
*
* @param {FlexibleDateTime} date
* A Date object, a number of UTC days since the J2000 epoch (noon on January 1, 2000),
* or an AstroTime object.
*
* @returns {LibrationInfo}
*/
export declare function Libration(date: FlexibleDateTime): LibrationInfo;
/**
* @brief Calculates Greenwich Apparent Sidereal Time (GAST).
*
* Given a date and time, this function calculates the rotation of the
* Earth, represented by the equatorial angle of the Greenwich prime meridian
* with respect to distant stars (not the Sun, which moves relative to background
* stars by almost one degree per day).
* This angle is called Greenwich Apparent Sidereal Time (GAST).
* GAST is measured in sidereal hours in the half-open range [0, 24).
* When GAST = 0, it means the prime meridian is aligned with the of-date equinox,
* corrected at that time for precession and nutation of the Earth's axis.
* In this context, the "equinox" is the direction in space where the Earth's
* orbital plane (the ecliptic) intersects with the plane of the Earth's equator,
* at the location on the Earth's orbit of the (seasonal) March equinox.
* As the Earth rotates, GAST increases from 0 up to 24 sidereal hours,
* then starts over at 0.
* To convert to degrees, multiply the return value by 15.
*
* @param {FlexibleDateTime} date
* The date and time for which to find GAST.
*
* @returns {number}
*/
export declare function SiderealTime(date: FlexibleDateTime): number;
/**
* @brief A 3D Cartesian vector with a time attached to it.
*
* Holds the Cartesian coordinates of a vector in 3D space,
* along with the time at which the vector is valid.
*
* @property {number} x The x-coordinate expressed in astronomical units (AU).
* @property {number} y The y-coordinate expressed in astronomical units (AU).
* @property {number} z The z-coordinate expressed in astronomical units (AU).
* @property {AstroTime} t The time at which the vector is valid.
*/
export declare class Vector {
x: number;
y: number;
z: number;
t: AstroTime;
constructor(x: number, y: number, z: number, t: AstroTime);
/**
* Returns the length of the vector in astronomical units (AU).
* @returns {number}
*/
Length(): number;
}
/**
* @brief A combination of a position vector, a velocity vector, and a time.
*
* Holds the state vector of a body at a given time, including its position,
* velocity, and the time they are valid.
*
* @property {number} x The position x-coordinate expressed in astronomical units (AU).
* @property {number} y The position y-coordinate expressed in astronomical units (AU).
* @property {number} z The position z-coordinate expressed in astronomical units (AU).
* @property {number} vx The velocity x-coordinate expressed in AU/day.
* @property {number} vy The velocity y-coordinate expressed in AU/day.
* @property {number} vz The velocity z-coordinate expressed in AU/day.
* @property {AstroTime} t The time at which the vector is valid.
*/
export declare class StateVector {
x: number;
y: number;
z: number;
vx: number;
vy: number;
vz: number;
t: AstroTime;
constructor(x: number, y: number, z: number, vx: number, vy: number, vz: number, t: AstroTime);
}
/**
* @brief Holds spherical coordinates: latitude, longitude, distance.
*
* Spherical coordinates represent the location of
* a point using two angles and a distance.
*
* @property {number} lat The latitude angle: -90..+90 degrees.
* @property {number} lon The longitude angle: 0..360 degrees.
* @property {number} dist Distance in AU.
*/
export declare class Spherical {
lat: number;
lon: number;
dist: number;
constructor(lat: number, lon: number, dist: number);
}
/**
* @brief Holds right ascension, declination, and distance of a celestial object.
*
* @property {number} ra
* Right ascension in sidereal hours: [0, 24).
*
* @property {number} dec
* Declination in degrees: [-90, +90].
*
* @property {number} dist
* Distance to the celestial object expressed in
* <a href="https://en.wikipedia.org/wiki/Astronomical_unit">astronomical units</a> (AU).
*
* @property {Vector} vec
* The equatorial coordinates in cartesian form, using AU distance units.
* x = direction of the March equinox,
* y = direction of the June solstice,
* z = north.
*/
export declare class EquatorialCoordinates {
ra: number;
dec: number;
dist: number;
vec: Vector;
constructor(ra: number, dec: number, dist: number, vec: Vector);
}
/**
* @brief Contains a rotation matrix that can be used to transform one coordinate system to another.
*
* @property {number[][]} rot
* A normalized 3x3 rotation matrix. For example, the identity matrix is represented
* as `[[1, 0, 0], [0, 1, 0], [0, 0, 1]]`.
*/
export declare class RotationMatrix {
rot: number[][];
constructor(rot: number[][]);
}
/**
* @brief Creates a rotation matrix that can be used to transform one coordinate system to another.
*
* This function verifies that the `rot` parameter is of the correct format:
* a number[3][3] array. It throws an exception if `rot` is not of that shape.
* Otherwise it creates a new {@link RotationMatrix} object based on `rot`.
*
* @param {number[][]} rot
* An array [3][3] of numbers. Defines a rotation matrix used to premultiply
* a 3D vector to reorient it into another coordinate system.
*
* @returns {RotationMatrix}
*/
export declare function MakeRotation(rot: number[][]): RotationMatrix;
/**
* @brief Represents the location of an object seen by an observer on the Earth.
*
* Holds azimuth (compass direction) and altitude (angle above/below the horizon)
* of a celestial object as seen by an observer at a particular location on the Earth's surface.
* Also holds right ascension and declination of the same object.
* All of these coordinates are optionally adjusted for atmospheric refraction;
* therefore the right ascension and declination values may not exactly match
* those found inside a corresponding {@link EquatorialCoordinates} object.
*
* @property {number} azimuth
* A horizontal compass direction angle in degrees measured starting at north
* and increasing positively toward the east.
* The value is in the range [0, 360).
* North = 0, east = 90, south = 180, west = 270.
*
* @property {number} altitude
* A vertical angle in degrees above (positive) or below (negative) the horizon.
* The value is in the range [-90, +90].
* The altitude angle is optionally adjusted upward due to atmospheric refraction.
*
* @property {number} ra
* The right ascension of the celestial body in sidereal hours.
* The value is in the reange [0, 24).
* If `altitude` was adjusted for atmospheric reaction, `ra`
* is likewise adjusted.
*
* @property {number} dec
* The declination of of the celestial body in degrees.
* The value in the range [-90, +90].
* If `altitude` was adjusted for atmospheric reaction, `dec`
* is likewise adjusted.
*/
export declare class HorizontalCoordinates {
azimuth: number;
altitude: number;
ra: number;
dec: number;
constructor(azimuth: number, altitude: number, ra: number, dec: number);
}
/**
* @brief Ecliptic coordinates of a celestial body.
*
* The origin and date of the coordinate system may vary depending on the caller's usage.
* In general, ecliptic coordinates are measured with respect to the mean plane of the Earth's
* orbit around the Sun.
* Includes Cartesian coordinates `(ex, ey, ez)` measured in
* <a href="https://en.wikipedia.org/wiki/Astronomical_unit">astronomical units</a> (AU)
* and spherical coordinates `(elon, elat)` measured in degrees.
*
* @property {Vector} vec
* Ecliptic cartesian vector with components measured in astronomical units (AU).
* The x-axis is within the ecliptic plane and is oriented in the direction of the
* <a href="https://en.wikipedia.org/wiki/Equinox_(celestial_coordinates)">equinox</a>.
* The y-axis is within the ecliptic plane and is oriented 90 degrees
* counterclockwise from the equinox, as seen from above the Sun's north pole.
* The z-axis is oriented perpendicular to the ecliptic plane,
* along the direction of the Sun's north pole.
*
* @property {number} elat
* The ecliptic latitude of the body in degrees.
* This is the angle north or south of the ecliptic plane.
* The value is in the range [-90, +90].
* Positive values are north and negative values are south.
*
* @property {number} elon
* The ecliptic longitude of the body in degrees.
* This is the angle measured counterclockwise around the ecliptic plane,
* as seen from above the Sun's north pole.
* This is the same direction that the Earth orbits around the Sun.
* The angle is measured starting at 0 from the equinox and increases
* up to 360 degrees.
*/
export declare class EclipticCoordinates {
vec: Vector;
elat: number;
elon: number;
constructor(vec: Vector, elat: number, elon: number);
}
/**
* @brief Converts equatorial coordinates to horizontal coordinates.
*
* Given a date and time, a geographic location of an observer on the Earth, and
* equatorial coordinates (right ascension and declination) of a celestial body,
* returns horizontal coordinates (azimuth and altitude angles) for that body
* as seen by that observer. Allows optional correction for atmospheric refraction.
*
* @param {FlexibleDateTime} date
* The date and time for which to find horizontal coordinates.
*
* @param {Observer} observer
* The location of the observer for which to find horizontal coordinates.
*
* @param {number} ra
* Right ascension in sidereal hours of the celestial object,
* referred to the mean equinox of date for the J2000 epoch.
*
* @param {number} dec
* Declination in degrees of the celestial object,
* referred to the mean equator of date for the J2000 epoch.
* Positive values are north of the celestial equator and negative values are south.
*
* @param {string} refraction
* If omitted or has a false-like value (false, null, undefined, etc.)
* the calculations are performed without any correction for atmospheric
* refraction. If the value is the string `"normal"`,
* uses the recommended refraction correction based on Meeus "Astronomical Algorithms"
* with a linear taper more than 1 degree below the horizon. The linear
* taper causes the refraction to linearly approach 0 as the altitude of the
* body approaches the nadir (-90 degrees).
* If the value is the string `"jplhor"`, uses a JPL Horizons
* compatible formula. This is the same algorithm as `"normal"`,
* only without linear tapering; this can result in physically impossible
* altitudes of less than -90 degrees, which may cause problems for some applications.
* (The `"jplhor"` option was created for unit testing against data
* generated by JPL Horizons, and is otherwise not recommended for use.)
*
* @returns {HorizontalCoordinates}
*/
export declare function Horizon(date: FlexibleDateTime, observer: Observer, ra: number, dec: number, refraction?: string): HorizontalCoordinates;
/**
* @brief Represents the geographic location of an observer on the surface of the Earth.
*
* @property {number} latitude
* The observer's geographic latitude in degrees north of the Earth's equator.
* The value is negative for observers south of the equator.
* Must be in the range -90 to +90.
*
* @property {number} longitude
* The observer's geographic longitude in degrees east of the prime meridian
* passing through Greenwich, England.
* The value is negative for observers west of the prime meridian.
* The value should be kept in the range -180 to +180 to minimize floating point errors.
*
* @property {number} height
* The observer's elevation above mean sea level, expressed in meters.
*/
export declare class Observer {
latitude: number;
longitude: number;
height: number;
constructor(latitude: number, longitude: number, height: number);
}
/**
* @brief Returns apparent geocentric true ecliptic coordinates of date for the Sun.
*
* This function is used for calculating the times of equinoxes and solstices.
*
* <i>Geocentric</i> means coordinates as the Sun would appear to a hypothetical observer
* at the center of the Earth.
* <i>Ecliptic coordinates of date</i> are measured along the plane of the Earth's mean
* orbit around the Sun, using the
* <a href="https://en.wikipedia.org/wiki/Equinox_(celestial_coordinates)">equinox</a>
* of the Earth as adjusted for precession and nutation of the Earth's
* axis of rotation on the given date.
*
* @param {FlexibleDateTime} date
* The date and time at which to calculate the Sun's apparent location as seen from
* the center of the Earth.
*
* @returns {EclipticCoordinates}
*/
export declare function SunPosition(date: FlexibleDateTime): EclipticCoordinates;
/**
* @brief Calculates equatorial coordinates of a Solar System body at a given time.
*
* Returns topocentric equatorial coordinates (right ascension and declination)
* in one of two different systems: J2000 or true-equator-of-date.
* Allows optional correction for aberration.
* Always corrects for light travel time (represents the object as seen by the observer
* with light traveling to the Earth at finite speed, not where the object is right now).
* <i>Topocentric</i> refers to a position as seen by an observer on the surface of the Earth.
* This function corrects for
* <a href="https://en.wikipedia.org/wiki/Parallax">parallax</a>
* of the object between a geocentric observer and a topocentric observer.
* This is most significant for the Moon, because it is so close to the Earth.
* However, it can have a small effect on the apparent positions of other bodies.
*
* @param {Body} body
* The body for which to find equatorial coordinates.
* Not allowed to be `Body.Earth`.
*
* @param {FlexibleDateTime} date
* Specifies the date and time at which the body is to be observed.
*
* @param {Observer} observer
* The location on the Earth of the observer.
*
* @param {bool} ofdate
* Pass `true` to return equatorial coordinates of date,
* i.e. corrected for precession and nutation at the given date.
* This is needed to get correct horizontal coordinates when you call
* {@link Horizon}.
* Pass `false` to return equatorial coordinates in the J2000 system.
*
* @param {bool} aberration
* Pass `true` to correct for
* <a href="https://en.wikipedia.org/wiki/Aberration_of_light">aberration</a>,
* or `false` to leave uncorrected.
*
* @returns {EquatorialCoordinates}
* The topocentric coordinates of the body as adjusted for the given observer.
*/
export declare function Equator(body: Body, date: FlexibleDateTime, observer: Observer, ofdate: boolean, aberration: boolean): EquatorialCoordinates;
/**
* @brief Calculates geocentric equatorial coordinates of an observer on the surface of the Earth.
*
* This function calculates a vector from the center of the Earth to
* a point on or near the surface of the Earth, expressed in equatorial
* coordinates. It takes into account the rotation of the Earth at the given
* time, along with the given latitude, longitude, and elevation of the observer.
*
* The caller may pass `ofdate` as `true` to return coordinates relative to the Earth's
* equator at the specified time, or `false` to use the J2000 equator.
*
* The returned vector has components expressed in astronomical units (AU).
* To convert to kilometers, multiply the `x`, `y`, and `z` values by
* the constant value {@link KM_PER_AU}.
*
* The inverse of this function is also available: {@link VectorObserver}.
*
* @param {FlexibleDateTime} date
* The date and time for which to calculate the observer's position vector.
*
* @param {Observer} observer
* The geographic location of a point on or near the surface of the Earth.
*
* @param {boolean} ofdate
* Selects the date of the Earth's equator in which to express the equatorial coordinates.
* The caller may pass `false` to use the orientation of the Earth's equator
* at noon UTC on January 1, 2000, in which case this function corrects for precession
* and nutation of the Earth as it was at the moment specified by the `time` parameter.
* Or the caller may pass `true` to use the Earth's equator at `time`
* as the orientation.
*
* @returns {Vector}
* An equatorial vector from the center of the Earth to the specified location
* on (or near) the Earth's surface.
*/
export declare function ObserverVector(date: FlexibleDateTime, observer: Observer, ofdate: boolean): Vector;
/**
* @brief Calculates geocentric equatorial position and velocity of an observer on the surface of the Earth.
*
* This function calculates position and velocity vectors of an observer
* on or near the surface of the Earth, expressed in equatorial
* coordinates. It takes into account the rotation of the Earth at the given
* time, along with the given latitude, longitude, and elevation of the observer.
*
* The caller may pass `ofdate` as `true` to return coordinates relative to the Earth's
* equator at the specified time, or `false` to use the J2000 equator.
*
* The returned position vector has components expressed in astronomical units (AU).
* To convert to kilometers, multiply the `x`, `y`, and `z` values by
* the constant value {@link KM_PER_AU}.
* The returned velocity vector has components expressed in AU/day.
*
* @param {FlexibleDateTime} date
* The date and time for which to calculate the observer's position and velocity vectors.
*
* @param {Observer} observer
* The geographic location of a point on or near the surface of the Earth.
*
* @param {boolean} ofdate
* Selects the date of the Earth's equator in which to express the equatorial coordinates.
* The caller may pass `false` to use the orientation of the Earth's equator
* at noon UTC on January 1, 2000, in which case this function corrects for precession
* and nutation of the Earth as it was at the moment specified by the `time` parameter.
* Or the caller may pass `true` to use the Earth's equator at `time`
* as the orientation.
*
* @returns {StateVector}
*/
export declare function ObserverState(date: FlexibleDateTime, observer: Observer, ofdate: boolean): StateVector;
/**
* @brief Calculates the geographic location corresponding to an equatorial vector.
*
* This is the inverse function of {@link ObserverVector}.
* Given a geocentric equatorial vector, it returns the geographic
* latitude, longitude, and elevation for that vector.
*
* @param {Vector} vector
* The geocentric equatorial position vector for which to find geographic coordinates.
* The components are expressed in Astronomical Units (AU).
* You can calculate AU by dividing kilometers by the constant {@link KM_PER_AU}.
* The time `vector.t` determines the Earth's rotation.
*
* @param {boolean} ofdate
* Selects the date of the Earth's equator in which `vector` is expressed.
* The caller may select `false` to use the orientation of the Earth's equator
* at noon UTC on January 1, 2000, in which case this function corrects for precession
* and nutation of the Earth as it was at the moment specified by `vector.t`.
* Or the caller may select `true` to use the Earth's equator at `vector.t`
* as the orientation.
*
* @returns {Observer}
* The geographic latitude, longitude, and elevation above sea level
* that corresponds to the given equatorial vector.
*/
export declare function VectorObserver(vector: Vector, ofdate: boolean): Observer;
/**
* @brief Calculates the gravitational acceleration experienced by an observer on the Earth.
*
* This function implements the WGS 84 Ellipsoidal Gravity Formula.
* The result is a combination of inward gravitational acceleration
* with outward centrifugal acceleration, as experienced by an observer
* in the Earth's rotating frame of reference.
* The resulting value increases toward the Earth's poles and decreases
* toward the equator, consistent with changes of the weight measured
* by a spring scale of a fixed mass moved to different latitudes and heights
* on the Earth.
*
* @param {number} latitude
* The latitude of the observer in degrees north or south of the equator.
* By formula symmetry, positive latitudes give the same answer as negative
* latitudes, so the sign does not matter.
*
* @param {number} height
* The height above the sea level geoid in meters.
* No range checking is done; however, accuracy is only valid in the
* range 0 to 100000 meters.
*
* @returns {number}
* The effective gravitational acceleration expressed in meters per second squared [m/s^2].
*/
export declare function ObserverGravity(latitude: number, height: number): number;
/**
* @brief Converts a J2000 mean equator (EQJ) vector to a true ecliptic of date (ETC) vector and angles.
*
* Given coordinates relative to the Earth's equator at J2000 (the instant of noon UTC
* on 1 January 2000), this function converts those coordinates to true ecliptic coordinates
* that are relative to the plane of the Earth's orbit around the Sun on that date.
*
* @param {Vector} eqj
* Equatorial coordinates in the EQJ frame of reference.
* You can call {@link GeoVector} to obtain suitable equatorial coordinates.
*
* @returns {EclipticCoordinates}
*/
export declare function Ecliptic(eqj: Vector): EclipticCoordinates;
/**
* @brief Calculates equatorial geocentric Cartesian coordinates for the Moon.
*
* Given a time of observation, calculates the Moon's position as a vector.
* The vector gives the location of the Moon's center relative to the Earth's center
* with x-, y-, and z-components measured in astronomical units.
* The coordinates are oriented with respect to the Earth's equator at the J2000 epoch.
* In Astronomy Engine, this orientation is called EQJ.
* Based on the Nautical Almanac Office's <i>Improved Lunar Ephemeris</i> of 1954,
* which in turn derives from E. W. Brown's lunar theories.
* Adapted from Turbo Pascal code from the book
* <a href="https://www.springer.com/us/book/9783540672210">Astronomy on the Personal Computer</a>
* by Montenbruck and Pfleger.
*
* @param {FlexibleDateTime} date
* The date and time for which to calculate the Moon's geocentric position.
*
* @returns {Vector}
*/
export declare function GeoMoon(date: FlexibleDateTime): Vector;
/**
* @brief Calculates spherical ecliptic geocentric position of the Moon.
*
* Given a time of observation, calculates the Moon's geocentric position
* in ecliptic spherical coordinates. Provides the ecliptic latitude and
* longitude in degrees, and the geocentric distance in astronomical units (AU).
*
* The ecliptic angles are measured in "ECT": relative to the true ecliptic plane and
* equatorial plane at the specified time. This means the Earth's equator
* is corrected for precession and nutation, and the plane of the Earth's
* orbit is corrected for gradual obliquity drift.
*
* This algorithm is based on the Nautical Almanac Office's <i>Improved Lunar Ephemeris</i> of 1954,
* which in turn derives from E. W. Brown's lunar theories from the early twentieth century.
* It is adapted from Turbo Pascal code from the book
* <a href="https://www.springer.com/us/book/9783540672210">Astronomy on the Personal Computer</a>
* by Montenbruck and Pfleger.
*
* To calculate a J2000 mean equator vector instead, use {@link GeoMoon}.
*
* @param {FlexibleDateTime} date
* The date and time for which to calculate the Moon's position.
*
* @returns {Spherical}
*/
export declare function EclipticGeoMoon(date: FlexibleDateTime): Spherical;
/**
* @brief Calculates equatorial geocentric position and velocity of the Moon at a given time.
*
* Given a time of observation, calculates the Moon's position and velocity vectors.
* The position and velocity are of the Moon's center relative to the Earth's center.
* The position (x, y, z) components are expressed in AU (astronomical units).
* The velocity (vx, vy, vz) components are expressed in AU/day.
* The coordinates are oriented with respect to the Earth's equator at the J2000 epoch.
* In Astronomy Engine, this orientation is called EQJ.
* If you need the Moon's position only, and not its velocity,
* it is much more efficient to use {@link GeoMoon} instead.
*
* @param {FlexibleDateTime} date
* The date and time for which to calculate the Moon's geocentric state.
*
* @returns {StateVector}
*/
export declare function GeoMoonState(date: FlexibleDateTime): StateVector;
/**
* @brief Calculates the geocentric position and velocity of the Earth/Moon barycenter.
*
* Given a time of observation, calculates the geocentric position and velocity vectors
* of the Earth/Moon barycenter (EMB).
* The position (x, y, z) components are expressed in AU (astronomical units).
* The velocity (vx, vy, vz) components are expressed in AU/day.
*
* @param {FlexibleDateTime} date
* The date and time for which to calculate the EMB's geocentric state.
*
* @returns {StateVector}
*/
export declare function GeoEmbState(date: FlexibleDateTime): StateVector;
/**
* @brief Holds the positions and velocities of Jupiter's major 4 moons.
*
* The {@link JupiterMoons} function returns an object of this type
* to report position and velocity vectors for Jupiter's largest 4 moons
* Io, Europa, Ganymede, and Callisto. Each position vector is relative
* to the center of Jupiter. Both position and velocity are oriented in
* the EQJ system (that is, using Earth's equator at the J2000 epoch).
* The positions are expressed in astronomical units (AU),
* and the velocities in AU/day.
*
* @property {StateVector} io
* The position and velocity of Jupiter's moon Io.
*
* @property {StateVector} europa
* The position and velocity of Jupiter's moon Europa.
*
* @property {StateVector} ganymede
* The position and velocity of Jupiter's moon Ganymede.
*
* @property {StateVector} callisto
* The position and velocity of Jupiter's moon Callisto.
*/
export declare class JupiterMoonsInfo {
io: StateVector;
europa: StateVector;
ganymede: StateVector;
callisto: StateVector;
constructor(io: StateVector, europa: StateVector, ganymede: StateVector, callisto: StateVector);
}
/**
* @brief Calculates jovicentric positions and velocities of Jupiter's largest 4 moons.
*
* Calculates position and velocity vectors for Jupiter's moons
* Io, Europa, Ganymede, and Callisto, at the given date and time.
* The vectors are jovicentric (relative to the center of Jupiter).
* Their orientation is the Earth's equatorial system at the J2000 epoch (EQJ).
* The position components are expressed in astronomical units (AU), and the
* velocity components are in AU/day.
*
* To convert to heliocentric vectors, call {@link HelioVector}
* with `Astronomy.Body.Jupiter` to get Jupiter's heliocentric position, then
* add the jovicentric vectors. Likewise, you can call {@link GeoVector}
* to convert to geocentric vectors.
*
* @param {FlexibleDateTime} date
* The date and time for which to calculate Jupiter's moons.
*
* @return {JupiterMoonsInfo}
* Position and velocity vectors of Jupiter's largest 4 moons.
*/
export declare function JupiterMoons(date: FlexibleDateTime): JupiterMoonsInfo;
/**
* @brief Calculates a vector from the center of the Sun to the given body at the given time.
*
* Calculates heliocentric (i.e., with respect to the center of the Sun)
* Cartesian coordinates in the J2000 equatorial system of a celestial
* body at a specified time. The position is not corrected for light travel time or aberration.
*
* @param {Body} body
* One of the following values:
* `Body.Sun`, `Body.Moon`, `Body.Mercury`, `Body.Venus`,
* `Body.Earth`, `Body.Mars`, `Body.Jupiter`, `Body.Saturn`,
* `Body.Uranus`, `Body.Neptune`, `Body.Pluto`,
* `Body.SSB`, or `Body.EMB`.
* Also allowed to be a user-defined star created by {@link DefineStar}.
*
* @param {FlexibleDateTime} date
* The date and time for which the body's position is to be calculated.