@openglobus/og 0.16.3 → 0.17.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 (197) hide show
  1. package/README.md +1 -1
  2. package/css/og.css +24 -2
  3. package/dist/@openglobus/og.css +1 -1
  4. package/dist/@openglobus/og.esm.js +2 -2
  5. package/dist/@openglobus/og.esm.js.map +1 -1
  6. package/dist/@openglobus/og.umd.js +2 -2
  7. package/dist/@openglobus/og.umd.js.map +1 -1
  8. package/package.json +1 -1
  9. package/src/og/Clock.js +1 -5
  10. package/src/og/Events.js +2 -6
  11. package/src/og/Extent.js +5 -9
  12. package/src/og/Globe.js +93 -56
  13. package/src/og/ImageCanvas.js +13 -6
  14. package/src/og/Lock.js +44 -48
  15. package/src/og/LonLat.js +1 -5
  16. package/src/og/Object3d.js +2 -2
  17. package/src/og/QueueArray.js +1 -1
  18. package/src/og/Stack.js +49 -53
  19. package/src/og/astro/earth.js +112 -116
  20. package/src/og/astro/jd.js +514 -518
  21. package/src/og/astro/orbit.js +119 -123
  22. package/src/og/astro/rotation.js +36 -40
  23. package/src/og/bv/Box.js +77 -81
  24. package/src/og/bv/Sphere.js +57 -61
  25. package/src/og/camera/Camera.js +20 -7
  26. package/src/og/camera/Frustum.js +4 -4
  27. package/src/og/camera/PlanetCamera.js +15 -22
  28. package/src/og/cons.js +1 -1
  29. package/src/og/control/Atmosphere.js +0 -4
  30. package/src/og/control/Control.js +9 -8
  31. package/src/og/control/DebugInfo.js +3 -7
  32. package/src/og/control/DrawingSwitcher.js +117 -0
  33. package/src/og/control/EarthCoordinates.js +214 -214
  34. package/src/og/control/EarthNavigation.js +6 -13
  35. package/src/og/control/GeoImageDragControl.js +0 -4
  36. package/src/og/control/KeyboardNavigation.js +0 -4
  37. package/src/og/control/LayerAnimation.js +0 -4
  38. package/src/og/control/LayerSwitcher.js +2 -4
  39. package/src/og/control/Lighting.js +12 -16
  40. package/src/og/control/MouseNavigation.js +1 -5
  41. package/src/og/control/MouseWheelZoomControl.js +0 -4
  42. package/src/og/control/RulerSwitcher.js +0 -4
  43. package/src/og/control/ScaleControl.js +2 -6
  44. package/src/og/control/ShowFps.js +40 -44
  45. package/src/og/control/SimpleNavigation.js +10 -10
  46. package/src/og/control/SimpleSkyBackground.js +0 -4
  47. package/src/og/control/Sun.js +0 -4
  48. package/src/og/control/ToggleWireframe.js +35 -39
  49. package/src/og/control/ZoomControl.js +0 -4
  50. package/src/og/control/drawing/DrawingControl.js +51 -0
  51. package/src/og/control/drawing/LineStringDrawingScene.js +203 -0
  52. package/src/og/control/drawing/PolygonDrawingScene.js +785 -0
  53. package/src/og/control/elevationProfile/ElevationProfile.js +275 -0
  54. package/src/og/control/index.js +5 -1
  55. package/src/og/control/ruler/Ruler.js +0 -4
  56. package/src/og/control/ruler/RulerScene.js +3 -2
  57. package/src/og/control/selection/Selection.js +0 -4
  58. package/src/og/control/selection/SelectionScene.js +2 -4
  59. package/src/og/control/timeline/TimelineControl.js +4 -4
  60. package/src/og/control/timeline/TimelineModel.js +2 -2
  61. package/src/og/control/timeline/TimelineView.js +1 -0
  62. package/src/og/control/visibleExtent/Segment.js +7 -7
  63. package/src/og/control/visibleExtent/drawnode.js +0 -4
  64. package/src/og/ellipsoid/Ellipsoid.js +236 -325
  65. package/src/og/ellipsoid/wgs84.js +0 -4
  66. package/src/og/entity/BaseBillboard.js +375 -379
  67. package/src/og/entity/Billboard.js +0 -4
  68. package/src/og/entity/BillboardHandler.js +3 -7
  69. package/src/og/entity/Entity.js +22 -22
  70. package/src/og/entity/EntityCollection.js +14 -18
  71. package/src/og/entity/GeoObject.js +6 -8
  72. package/src/og/entity/GeoObjectHandler.js +30 -24
  73. package/src/og/entity/Geometry.js +5 -4
  74. package/src/og/entity/GeometryHandler.js +18 -19
  75. package/src/og/entity/Label.js +0 -4
  76. package/src/og/entity/LabelHandler.js +10 -14
  77. package/src/og/entity/LabelWorker.js +1 -1
  78. package/src/og/entity/PointCloud.js +2 -6
  79. package/src/og/entity/PointCloudHandler.js +122 -126
  80. package/src/og/entity/Polyline.js +15 -17
  81. package/src/og/entity/PolylineHandler.js +104 -108
  82. package/src/og/entity/Ray.js +29 -29
  83. package/src/og/entity/RayHandler.js +2 -2
  84. package/src/og/entity/Strip.js +1 -1
  85. package/src/og/entity/StripHandler.js +2 -2
  86. package/src/og/index.js +3 -1
  87. package/src/og/input/KeyboardHandler.js +128 -132
  88. package/src/og/input/MouseHandler.js +94 -98
  89. package/src/og/input/TouchHandler.js +59 -63
  90. package/src/og/input/input.js +44 -48
  91. package/src/og/layer/BaseGeoImage.js +6 -9
  92. package/src/og/layer/CanvasTiles.js +1 -5
  93. package/src/og/layer/GeoImage.js +0 -4
  94. package/src/og/layer/GeoTexture2d.js +0 -4
  95. package/src/og/layer/GeoVideo.js +0 -4
  96. package/src/og/layer/KML.js +1 -0
  97. package/src/og/layer/Layer.js +22 -26
  98. package/src/og/layer/Material.js +0 -4
  99. package/src/og/layer/Vector.js +25 -22
  100. package/src/og/layer/WMS.js +182 -186
  101. package/src/og/layer/XYZ.js +0 -4
  102. package/src/og/light/LightSource.js +0 -4
  103. package/src/og/math/Line2.js +28 -32
  104. package/src/og/math/Mat3.js +152 -156
  105. package/src/og/math/Ray.js +0 -4
  106. package/src/og/math/Vec2.js +0 -4
  107. package/src/og/math/Vec3.js +5 -4
  108. package/src/og/math/Vec4.js +0 -4
  109. package/src/og/math/coder.js +104 -104
  110. package/src/og/math.js +42 -10
  111. package/src/og/mercator.js +1 -1
  112. package/src/og/proj/EPSG3857.js +13 -13
  113. package/src/og/proj/Proj.js +59 -63
  114. package/src/og/quadTree/EPSG4326QuadTreeStrategy.js +1 -0
  115. package/src/og/quadTree/EarthQuadTreeStrategy.js +1 -0
  116. package/src/og/quadTree/EntityCollectionNode.js +12 -16
  117. package/src/og/quadTree/MarsQuadTreeStrategy.js +1 -0
  118. package/src/og/quadTree/Node.js +15 -14
  119. package/src/og/quadTree/QuadTreeStrategy.js +1 -0
  120. package/src/og/quadTree/Wgs84QuadTreeStrategy.js +1 -0
  121. package/src/og/renderer/Renderer.js +114 -27
  122. package/src/og/renderer/RendererEvents.js +0 -4
  123. package/src/og/scene/Axes.js +74 -78
  124. package/src/og/scene/BaseNode.js +1 -5
  125. package/src/og/scene/Planet.js +127 -130
  126. package/src/og/scene/RenderNode.js +20 -12
  127. package/src/og/scene/SkyBox.js +104 -108
  128. package/src/og/segment/Segment.js +10 -6
  129. package/src/og/segment/SegmentLonLat.js +3 -7
  130. package/src/og/segment/segmentHelper.js +229 -225
  131. package/src/og/shaders/atmos.js +1 -1
  132. package/src/og/shaders/billboard.js +0 -4
  133. package/src/og/shaders/drawnode.js +5 -9
  134. package/src/og/shaders/geoObject.js +0 -4
  135. package/src/og/shaders/label.js +0 -4
  136. package/src/og/shaders/pickingMask.js +0 -4
  137. package/src/og/shaders/pointCloud.js +0 -4
  138. package/src/og/shaders/polyline.js +0 -4
  139. package/src/og/shaders/ray.js +0 -4
  140. package/src/og/shaders/skybox.js +0 -4
  141. package/src/og/terrain/EmptyTerrain.js +0 -4
  142. package/src/og/utils/FontAtlas.js +0 -4
  143. package/src/og/utils/GeoImageCreator.js +2 -3
  144. package/src/og/utils/NormalMapCreator.js +11 -12
  145. package/src/og/utils/PlainSegmentWorker.js +9 -9
  146. package/src/og/utils/TerrainWorker.js +2 -2
  147. package/src/og/utils/TextureAtlas.js +1 -1
  148. package/src/og/utils/VectorTileCreator.js +3 -9
  149. package/src/og/utils/earcut.js +8 -8
  150. package/src/og/utils/shared.js +30 -11
  151. package/src/og/webgl/Framebuffer.js +2 -6
  152. package/src/og/webgl/Handler.js +46 -20
  153. package/src/og/webgl/Multisample.js +2 -6
  154. package/src/og/webgl/Program.js +4 -8
  155. package/src/og/webgl/ProgramController.js +2 -2
  156. package/types/Clock.d.ts +1 -1
  157. package/types/Extent.d.ts +5 -5
  158. package/types/Globe.d.ts +15 -1
  159. package/types/ImageCanvas.d.ts +5 -0
  160. package/types/bv/Box.d.ts +1 -1
  161. package/types/bv/Sphere.d.ts +3 -3
  162. package/types/camera/Camera.d.ts +3 -2
  163. package/types/camera/PlanetCamera.d.ts +4 -4
  164. package/types/control/DrawingSwitcher.d.ts +13 -0
  165. package/types/control/EarthCoordinates.d.ts +1 -1
  166. package/types/control/Lighting.d.ts +8 -8
  167. package/types/control/drawing/DrawingControl.d.ts +14 -0
  168. package/types/control/drawing/LineStringDrawingScene.d.ts +5 -0
  169. package/types/control/drawing/PolygonDrawingScene.d.ts +99 -0
  170. package/types/control/index.d.ts +3 -1
  171. package/types/control/ruler/RulerScene.d.ts +0 -1
  172. package/types/control/selection/SelectionScene.d.ts +0 -1
  173. package/types/ellipsoid/Ellipsoid.d.ts +53 -64
  174. package/types/entity/Entity.d.ts +3 -2
  175. package/types/entity/GeoObject.d.ts +1 -2
  176. package/types/entity/Geometry.d.ts +5 -0
  177. package/types/entity/Polyline.d.ts +1 -1
  178. package/types/entity/Ray.d.ts +1 -0
  179. package/types/index.d.ts +1 -0
  180. package/types/layer/BaseGeoImage.d.ts +1 -1
  181. package/types/layer/CanvasTiles.d.ts +1 -1
  182. package/types/layer/Layer.d.ts +1 -1
  183. package/types/layer/Vector.d.ts +1 -0
  184. package/types/math/Vec3.d.ts +2 -0
  185. package/types/math.d.ts +7 -0
  186. package/types/renderer/Renderer.d.ts +7 -1
  187. package/types/scene/Axes.d.ts +0 -1
  188. package/types/scene/Planet.d.ts +27 -26
  189. package/types/scene/RenderNode.d.ts +2 -0
  190. package/types/scene/SkyBox.d.ts +0 -1
  191. package/types/segment/Segment.d.ts +3 -2
  192. package/types/segment/SegmentLonLat.d.ts +0 -1
  193. package/types/utils/GeoImageCreator.d.ts +1 -1
  194. package/types/utils/NormalMapCreator.d.ts +1 -1
  195. package/types/utils/VectorTileCreator.d.ts +2 -2
  196. package/types/utils/shared.d.ts +2 -0
  197. package/types/webgl/Handler.d.ts +6 -4
@@ -1,518 +1,514 @@
1
- /**
2
- * @module og/astro/jd
3
- */
4
-
5
- "use strict";
6
-
7
- import { binarySearch } from "../utils/shared.js";
8
-
9
- /**
10
- * Seconds in millisecond.
11
- * @const
12
- * @default
13
- */
14
- export const SECONDS_PER_MILLISECOND = 0.001;
15
-
16
- /**
17
- * Milliseconds in second.
18
- * @const
19
- * @default
20
- */
21
- export const MILLISECONDS_PER_SECOND = 1000.0;
22
-
23
- /**
24
- * Seconds in minute.
25
- * @const
26
- * @default
27
- */
28
- export const SECONDS_PER_MINUTE = 60.0;
29
-
30
- /**
31
- * One by seconds in minute.
32
- * @const
33
- * @default
34
- */
35
- export const ONE_BY_SECONDS_PER_MINUTE = 1.0 / SECONDS_PER_MINUTE;
36
-
37
- /**
38
- * Minutes in hour.
39
- * @const
40
- * @default
41
- */
42
- export const MINUTES_PER_HOUR = 60.0;
43
-
44
- /**
45
- * Hours in day.
46
- * @const
47
- * @default
48
- */
49
- export const HOURS_PER_DAY = 24.0;
50
-
51
- /**
52
- * One by hours in day.
53
- * @const
54
- * @default
55
- */
56
- export const ONE_BY_HOURS_PER_DAY = 1.0 / HOURS_PER_DAY;
57
-
58
- /**
59
- * Seconds in hour.
60
- * @const
61
- * @default
62
- */
63
- export const SECONDS_PER_HOUR = 3600.0;
64
-
65
- /**
66
- * One by seconds in hour.
67
- * @const
68
- * @default
69
- */
70
- export const ONE_BY_SECONDS_PER_HOUR = 1.0 / SECONDS_PER_HOUR;
71
-
72
- /**
73
- * Seconds in 12 hours.
74
- * @const
75
- * @default
76
- */
77
- export const SECONDS_PER_12_HOURS = 12.0 * SECONDS_PER_HOUR;
78
-
79
- /**
80
- * Minutes in day.
81
- * @const
82
- * @default
83
- */
84
- export const MINUTES_PER_DAY = 1440.0;
85
-
86
- /**
87
- * One by minutes in day.
88
- * @const
89
- * @default
90
- */
91
- export const ONE_BY_MINUTES_PER_DAY = 1.0 / MINUTES_PER_DAY;
92
-
93
- /**
94
- * Seconds in day.
95
- * @const
96
- * @default
97
- */
98
- export const SECONDS_PER_DAY = 86400.0;
99
-
100
- /**
101
- * Milliseconds in day.
102
- * @const
103
- * @default
104
- */
105
- export const MILLISECONDS_PER_DAY = 86400000.0;
106
-
107
- /**
108
- * One by milliseconds in day.
109
- * @const
110
- * @default
111
- */
112
- export const ONE_BY_MILLISECONDS_PER_DAY = 1.0 / MILLISECONDS_PER_DAY;
113
-
114
- /**
115
- * One by seconds in day.
116
- * @const
117
- * @default
118
- */
119
- export const ONE_BY_SECONDS_PER_DAY = 1.0 / SECONDS_PER_DAY;
120
-
121
- /**
122
- * Days in julian century.
123
- * @const
124
- * @default
125
- */
126
- export const DAYS_PER_JULIAN_CENTURY = 36525.0;
127
-
128
- /**
129
- * Days in julian year.
130
- * @const
131
- * @default
132
- */
133
- export const DAYS_PER_JULIAN_YEAR = 365.25;
134
-
135
- /**
136
- * Seconds in picosecond.
137
- * @const
138
- * @default
139
- */
140
- export const PICOSECOND = 0.000000001;
141
-
142
- /**
143
- * Modified julian date difference.
144
- * @const
145
- * @default
146
- */
147
- export const MODIFIED_JULIAN_DATE_DIFFERENCE = 2400000.5;
148
-
149
- /**
150
- * Julian date of 2000 year. Epoch.
151
- * @const
152
- * @default
153
- */
154
- export const J2000 = 2451545.0;
155
-
156
- /**
157
- * Returns julian days from Epoch.
158
- * @param {number} jd - Julian date.
159
- * @returns {number} Days from epoch
160
- */
161
- export function T(jd) {
162
- return (jd - J2000) / DAYS_PER_JULIAN_CENTURY;
163
- }
164
-
165
- /**
166
- * Gets the date's julian day.
167
- * @param {number} year - Year.
168
- * @param {number} month - Month.
169
- * @param {number} day - Day.
170
- * @returns {Number} Day number
171
- */
172
- export function getDayNumber(year, month, day) {
173
- var a = ((month - 14) / 12) | 0;
174
- var b = year + 4800 + a;
175
- return (
176
- (((1461 * b) / 4) | 0) +
177
- (((367 * (month - 2 - 12 * a)) / 12) | 0) -
178
- (((3 * (((b + 100) / 100) | 0)) / 4) | 0) +
179
- day -
180
- 32075
181
- );
182
- }
183
-
184
- /**
185
- * Converts javascript date to the universal(UTC) julian date.
186
- * @param {Date} date - Date.
187
- * @returns {number} UTC julian date
188
- */
189
- export function DateToUTC(date) {
190
- var dayNumber = getDayNumber(date.getUTCFullYear(), date.getUTCMonth() + 1, date.getUTCDate());
191
-
192
- var hour = date.getUTCHours() - 12;
193
- if (hour < 0) {
194
- hour += 24;
195
- }
196
-
197
- var secondsOfDay =
198
- date.getUTCSeconds() +
199
- hour * SECONDS_PER_HOUR +
200
- date.getUTCMinutes() * SECONDS_PER_MINUTE +
201
- date.getUTCMilliseconds() * SECONDS_PER_MILLISECOND;
202
-
203
- if (secondsOfDay >= SECONDS_PER_12_HOURS) {
204
- dayNumber--;
205
- }
206
-
207
- var extraDays = (secondsOfDay * ONE_BY_SECONDS_PER_DAY) | 0;
208
- dayNumber += extraDays;
209
- secondsOfDay -= SECONDS_PER_DAY * extraDays;
210
-
211
- if (secondsOfDay < 0) {
212
- dayNumber--;
213
- secondsOfDay += SECONDS_PER_DAY;
214
- }
215
-
216
- return dayNumber + secondsOfDay * ONE_BY_SECONDS_PER_DAY;
217
- }
218
-
219
- /**
220
- * Converts javascript date to the atomic(TAI) julian date.
221
- * @param {Date} date - Date.
222
- * @returns {number} TAI julian date
223
- */
224
- export function DateToTAI(date) {
225
- return UTCtoTAI(DateToUTC(date));
226
- }
227
-
228
- /**
229
- * Converts coordinated universal(UTC) julian date to atomic(TAI) julian date.
230
- * @param {number} jd - UTC julian date.
231
- * @returns {number} TAI julian date
232
- */
233
- export function UTCtoTAI(jd) {
234
- var leapSeconds = leapSecondsTable;
235
-
236
- var index = binarySearch(leapSeconds, jd, function (a, b) {
237
- return a - b.jd;
238
- });
239
-
240
- if (index < 0) {
241
- index = ~index;
242
- }
243
-
244
- if (index >= leapSeconds.length) {
245
- index = leapSeconds.length - 1;
246
- }
247
-
248
- var offset = leapSeconds[index].leapSeconds;
249
-
250
- if (index !== 0) {
251
- if ((leapSeconds[index].jd - jd) * SECONDS_PER_DAY > offset) {
252
- offset = leapSeconds[index - 1].leapSeconds;
253
- }
254
- }
255
-
256
- return jd + offset * ONE_BY_SECONDS_PER_DAY;
257
- }
258
-
259
- /**
260
- * Converts atomic julian date(TAI) to the coordinated universal(UTC) julian date.
261
- * @param {number} tai - TAI julian date.
262
- * @returns {number} UTC julian date
263
- */
264
- export function TAItoUTC(tai) {
265
- var leapSeconds = leapSecondsTable;
266
- var index = binarySearch(leapSeconds, tai, function (a, b) {
267
- return a - b.jd;
268
- });
269
-
270
- if (index < 0) {
271
- index = ~index;
272
- }
273
-
274
- if (index >= leapSeconds.length) {
275
- return tai - leapSeconds[index - 1].leapSeconds * ONE_BY_SECONDS_PER_DAY;
276
- }
277
-
278
- if (index === 0) {
279
- return tai - leapSeconds[0].leapSeconds * ONE_BY_SECONDS_PER_DAY;
280
- }
281
-
282
- var diff = (leapSeconds[index].jd - tai) * SECONDS_PER_DAY;
283
-
284
- if (diff === 0) {
285
- return tai - leapSeconds[index].leapSeconds * ONE_BY_SECONDS_PER_DAY;
286
- }
287
-
288
- if (diff <= 1.0) {
289
- return null;
290
- }
291
-
292
- return tai - leapSeconds[index - 1].leapSeconds * ONE_BY_SECONDS_PER_DAY;
293
- }
294
-
295
- /**
296
- * Converts UTC julian date to the javascript date object.
297
- * @param {number} utc - UTC julian date.
298
- * @returns {Date} JavaScript Date object
299
- */
300
- export function UTCtoDate(utc) {
301
- var julianDayNumber = utc | 0;
302
- var secondsOfDay = (utc - julianDayNumber) * SECONDS_PER_DAY;
303
-
304
- if (secondsOfDay >= SECONDS_PER_12_HOURS) {
305
- julianDayNumber++;
306
- }
307
-
308
- var L = (julianDayNumber + 68569) | 0;
309
- var N = ((4 * L) / 146097) | 0;
310
- L = (L - (((146097 * N + 3) / 4) | 0)) | 0;
311
- var I = ((4000 * (L + 1)) / 1461001) | 0;
312
- L = (L - (((1461 * I) / 4) | 0) + 31) | 0;
313
- var J = ((80 * L) / 2447) | 0;
314
- var day = (L - (((2447 * J) / 80) | 0)) | 0;
315
- L = (J / 11) | 0;
316
- var month = (J + 2 - 12 * L) | 0;
317
- var year = (100 * (N - 49) + I + L) | 0;
318
-
319
- var hour = (secondsOfDay * ONE_BY_SECONDS_PER_HOUR) | 0;
320
- var remainingSeconds = secondsOfDay - hour * SECONDS_PER_HOUR;
321
- var minute = (remainingSeconds * ONE_BY_SECONDS_PER_MINUTE) | 0;
322
- remainingSeconds = remainingSeconds - minute * SECONDS_PER_MINUTE;
323
- var second = remainingSeconds | 0;
324
- var millisecond = ((remainingSeconds - second) * MILLISECONDS_PER_SECOND) | 0;
325
-
326
- hour += 12;
327
- if (hour > 23) {
328
- hour -= 24;
329
- }
330
-
331
- return new Date(Date.UTC(year, month - 1, day, hour, minute, second, millisecond));
332
- }
333
-
334
- /**
335
- * Converts TAI julian date to the javascript date object.
336
- * @param {number} tai - TAI julian date.
337
- * @returns {Date} JavaScript Date object
338
- */
339
- export function TAItoDate(tai) {
340
- var utc = TAItoUTC(tai);
341
- if (!utc) {
342
- utc = TAItoUTC(addSeconds(tai, -1));
343
- console.warn("TAItoDate:336 - can't conv utc.");
344
- }
345
-
346
- return UTCtoDate(utc);
347
- }
348
-
349
- /**
350
- * Adds milliseconds to the julian date.
351
- * @param {number} jd - Julian date.
352
- * @param {number} milliseconds - Milliseconds to add.
353
- * @returns {number} Julian date
354
- */
355
- export function addMilliseconds(jd, milliseconds) {
356
- return jd + milliseconds * ONE_BY_MILLISECONDS_PER_DAY;
357
- }
358
-
359
- /**
360
- * Adds seconds to the julian date.
361
- * @param {number} jd - Julian date.
362
- * @param {number} seconds - Seconds to add.
363
- * @returns {number} Julian date
364
- */
365
- export function addSeconds(jd, seconds) {
366
- return jd + seconds * ONE_BY_SECONDS_PER_DAY;
367
- }
368
-
369
- /**
370
- * Adds hours to the julian date.
371
- * @param {number} jd - Julian date.
372
- * @param {number} hours - Hours to add.
373
- * @returns {number} Julian date
374
- */
375
- export function addHours(jd, hours) {
376
- return jd + hours * ONE_BY_HOURS_PER_DAY;
377
- }
378
-
379
- /**
380
- * Adds minutes to the julian date.
381
- * @param {number} jd - Julian date.
382
- * @param {number} minutes - Minutes to add.
383
- * @returns {number} Julian date
384
- */
385
- export function addMinutes(jd, minutes) {
386
- return jd + minutes * MINUTES_PER_DAY;
387
- }
388
-
389
- /**
390
- * Adds days to the julian date.
391
- * @param {number} jd - Julian date.
392
- * @param {number} days - Days to add.
393
- * @returns {number} Julian date
394
- */
395
- export function addDays(jd, days) {
396
- return jd + days;
397
- }
398
-
399
- /**
400
- * Gets milliseconds of a julian date.
401
- * @param {number} js - julian date.
402
- * @returns {number} Milliseconds
403
- */
404
- export function getMilliseconds(jd) {
405
- var s = jd - (jd | 0);
406
- s *= SECONDS_PER_DAY;
407
- return ((s - (s | 0)) * MILLISECONDS_PER_SECOND) | 0;
408
- }
409
-
410
- /**
411
- * Gets seconds of a julian date.
412
- * @param {number} js - julian date.
413
- * @returns {number} Seconds
414
- */
415
- export function getSeconds(jd) {
416
- var s = jd - (jd | 0);
417
- return s * SECONDS_PER_DAY;
418
- }
419
-
420
- /**
421
- * Gets hours of a julian date.
422
- * @param {number} js - julian date.
423
- * @returns {number} Hours
424
- */
425
- export function getHours(jd) {
426
- var julianDayNumber = jd | 0;
427
- var secondsOfDay = (jd - julianDayNumber) * SECONDS_PER_DAY;
428
-
429
- var hour = (secondsOfDay * ONE_BY_SECONDS_PER_HOUR) | 0;
430
- var remainingSeconds = secondsOfDay - hour * SECONDS_PER_HOUR;
431
- var minute = (remainingSeconds * ONE_BY_SECONDS_PER_MINUTE) | 0;
432
- remainingSeconds = remainingSeconds - minute * SECONDS_PER_MINUTE;
433
- var second = remainingSeconds | 0;
434
- var millisecond = ((remainingSeconds - second) * MILLISECONDS_PER_SECOND) | 0;
435
-
436
- hour += 12 + minute / 60 + second / 3600 + millisecond / 1000;
437
- if (hour > 23) {
438
- hour -= 24;
439
- }
440
-
441
- return hour;
442
- }
443
-
444
- /**
445
- * Gets minutes of a julian date.
446
- * @param {number} js - julian date.
447
- * @returns {number} Minutes
448
- */
449
- export function getMinutes(jd) {
450
- var s = jd - (jd | 0);
451
- return (s * MINUTES_PER_DAY) | 0;
452
- }
453
-
454
- /**
455
- * Gets days of a julian date.
456
- * @param {number} js - julian date.
457
- * @returns {number} Days
458
- */
459
- export function getDays(jd) {
460
- return jd | 0;
461
- }
462
-
463
- /**
464
- * Returns days in seconds.
465
- * @param {number} s - Seconds.
466
- * @returns {number} Days
467
- */
468
- export function secondsToDays(s) {
469
- return s * ONE_BY_SECONDS_PER_DAY;
470
- }
471
-
472
- /**
473
- * Returns seconds in days.
474
- * @param {number} d - Days.
475
- * @returns {number} Seconds
476
- */
477
- export function daysToSeconds(d) {
478
- return d * SECONDS_PER_DAY;
479
- }
480
-
481
- function __ls(jd, leapSeconds) {
482
- return {
483
- jd: jd,
484
- leapSeconds: leapSeconds
485
- };
486
- }
487
-
488
- const leapSecondsTable = [
489
- __ls(2441317.5, 10.0), // 1972-01-01T00:00:00.000Z
490
- __ls(2441499.5, 11.0), // 1972-07-01T00:00:00.000Z
491
- __ls(2441683.5, 12.0), // 1973-01-01T00:00:00.000Z
492
- __ls(2442048.5, 13.0), // 1974-01-01T00:00:00.000Z
493
- __ls(2442413.5, 14.0), // 1975-01-01T00:00:00.000Z
494
- __ls(2442778.5, 15.0), // 1976-01-01T00:00:00.000Z
495
- __ls(2443144.5, 16.0), // 1977-01-01T00:00:00.000Z
496
- __ls(2443509.5, 17.0), // 1978-01-01T00:00:00.000Z
497
- __ls(2443874.5, 18.0), // 1979-01-01T00:00:00.000Z
498
- __ls(2444239.5, 19.0), // 1980-01-01T00:00:00.000Z
499
- __ls(2444786.5, 20.0), // 1981-07-01T00:00:00.000Z
500
- __ls(2445151.5, 21.0), // 1982-07-01T00:00:00.000Z
501
- __ls(2445516.5, 22.0), // 1983-01-01T00:00:00.000Z
502
- __ls(2446247.5, 23.0), // 1985-07-01T00:00:00.000Z
503
- __ls(2447161.5, 24.0), // 1988-01-01T00:00:00.000Z
504
- __ls(2447892.5, 25.0), // 1990-01-01T00:00:00.000Z
505
- __ls(2448257.5, 26.0), // 1991-01-01T00:00:00.000Z
506
- __ls(2448804.5, 27.0), // 1992-07-01T00:00:00.000Z
507
- __ls(2449169.5, 28.0), // 1993-07-01T00:00:00.000Z
508
- __ls(2449534.5, 29.0), // 1994-07-01T00:00:00.000Z
509
- __ls(2450083.5, 30.0), // 1996-01-01T00:00:00.000Z
510
- __ls(2450630.5, 31.0), // 1997-07-01T00:00:00.000Z
511
- __ls(2451179.5, 32.0), // 1999-01-01T00:00:00.000Z
512
- __ls(2453736.5, 33.0), // 2006-01-01T00:00:00.000Z
513
- __ls(2454832.5, 34.0), // 2009-01-01T00:00:00.000Z
514
- __ls(2456109.5, 35.0), // 2012-07-01T00:00:00.000Z
515
- __ls(2457204.5, 36.0) // 2015-07-01T00:00:00.000Z
516
- ];
517
-
518
- export const J2000TAI = UTCtoTAI(J2000);
1
+ "use strict";
2
+
3
+ import { binarySearch } from "../utils/shared.js";
4
+
5
+ /**
6
+ * Seconds in millisecond.
7
+ * @const
8
+ * @default
9
+ */
10
+ export const SECONDS_PER_MILLISECOND = 0.001;
11
+
12
+ /**
13
+ * Milliseconds in second.
14
+ * @const
15
+ * @default
16
+ */
17
+ export const MILLISECONDS_PER_SECOND = 1000.0;
18
+
19
+ /**
20
+ * Seconds in minute.
21
+ * @const
22
+ * @default
23
+ */
24
+ export const SECONDS_PER_MINUTE = 60.0;
25
+
26
+ /**
27
+ * One by seconds in minute.
28
+ * @const
29
+ * @default
30
+ */
31
+ export const ONE_BY_SECONDS_PER_MINUTE = 1.0 / SECONDS_PER_MINUTE;
32
+
33
+ /**
34
+ * Minutes in hour.
35
+ * @const
36
+ * @default
37
+ */
38
+ export const MINUTES_PER_HOUR = 60.0;
39
+
40
+ /**
41
+ * Hours in day.
42
+ * @const
43
+ * @default
44
+ */
45
+ export const HOURS_PER_DAY = 24.0;
46
+
47
+ /**
48
+ * One by hours in day.
49
+ * @const
50
+ * @default
51
+ */
52
+ export const ONE_BY_HOURS_PER_DAY = 1.0 / HOURS_PER_DAY;
53
+
54
+ /**
55
+ * Seconds in hour.
56
+ * @const
57
+ * @default
58
+ */
59
+ export const SECONDS_PER_HOUR = 3600.0;
60
+
61
+ /**
62
+ * One by seconds in hour.
63
+ * @const
64
+ * @default
65
+ */
66
+ export const ONE_BY_SECONDS_PER_HOUR = 1.0 / SECONDS_PER_HOUR;
67
+
68
+ /**
69
+ * Seconds in 12 hours.
70
+ * @const
71
+ * @default
72
+ */
73
+ export const SECONDS_PER_12_HOURS = 12.0 * SECONDS_PER_HOUR;
74
+
75
+ /**
76
+ * Minutes in day.
77
+ * @const
78
+ * @default
79
+ */
80
+ export const MINUTES_PER_DAY = 1440.0;
81
+
82
+ /**
83
+ * One by minutes in day.
84
+ * @const
85
+ * @default
86
+ */
87
+ export const ONE_BY_MINUTES_PER_DAY = 1.0 / MINUTES_PER_DAY;
88
+
89
+ /**
90
+ * Seconds in day.
91
+ * @const
92
+ * @default
93
+ */
94
+ export const SECONDS_PER_DAY = 86400.0;
95
+
96
+ /**
97
+ * Milliseconds in day.
98
+ * @const
99
+ * @default
100
+ */
101
+ export const MILLISECONDS_PER_DAY = 86400000.0;
102
+
103
+ /**
104
+ * One by milliseconds in day.
105
+ * @const
106
+ * @default
107
+ */
108
+ export const ONE_BY_MILLISECONDS_PER_DAY = 1.0 / MILLISECONDS_PER_DAY;
109
+
110
+ /**
111
+ * One by seconds in day.
112
+ * @const
113
+ * @default
114
+ */
115
+ export const ONE_BY_SECONDS_PER_DAY = 1.0 / SECONDS_PER_DAY;
116
+
117
+ /**
118
+ * Days in julian century.
119
+ * @const
120
+ * @default
121
+ */
122
+ export const DAYS_PER_JULIAN_CENTURY = 36525.0;
123
+
124
+ /**
125
+ * Days in julian year.
126
+ * @const
127
+ * @default
128
+ */
129
+ export const DAYS_PER_JULIAN_YEAR = 365.25;
130
+
131
+ /**
132
+ * Seconds in picosecond.
133
+ * @const
134
+ * @default
135
+ */
136
+ export const PICOSECOND = 0.000000001;
137
+
138
+ /**
139
+ * Modified julian date difference.
140
+ * @const
141
+ * @default
142
+ */
143
+ export const MODIFIED_JULIAN_DATE_DIFFERENCE = 2400000.5;
144
+
145
+ /**
146
+ * Julian date of 2000 year. Epoch.
147
+ * @const
148
+ * @default
149
+ */
150
+ export const J2000 = 2451545.0;
151
+
152
+ /**
153
+ * Returns julian days from Epoch.
154
+ * @param {number} jd - Julian date.
155
+ * @returns {number} Days from epoch
156
+ */
157
+ export function T(jd) {
158
+ return (jd - J2000) / DAYS_PER_JULIAN_CENTURY;
159
+ }
160
+
161
+ /**
162
+ * Gets the date's julian day.
163
+ * @param {number} year - Year.
164
+ * @param {number} month - Month.
165
+ * @param {number} day - Day.
166
+ * @returns {Number} Day number
167
+ */
168
+ export function getDayNumber(year, month, day) {
169
+ var a = ((month - 14) / 12) | 0;
170
+ var b = year + 4800 + a;
171
+ return (
172
+ (((1461 * b) / 4) | 0) +
173
+ (((367 * (month - 2 - 12 * a)) / 12) | 0) -
174
+ (((3 * (((b + 100) / 100) | 0)) / 4) | 0) +
175
+ day -
176
+ 32075
177
+ );
178
+ }
179
+
180
+ /**
181
+ * Converts javascript date to the universal(UTC) julian date.
182
+ * @param {Date} date - Date.
183
+ * @returns {number} UTC julian date
184
+ */
185
+ export function DateToUTC(date) {
186
+ var dayNumber = getDayNumber(date.getUTCFullYear(), date.getUTCMonth() + 1, date.getUTCDate());
187
+
188
+ var hour = date.getUTCHours() - 12;
189
+ if (hour < 0) {
190
+ hour += 24;
191
+ }
192
+
193
+ var secondsOfDay =
194
+ date.getUTCSeconds() +
195
+ hour * SECONDS_PER_HOUR +
196
+ date.getUTCMinutes() * SECONDS_PER_MINUTE +
197
+ date.getUTCMilliseconds() * SECONDS_PER_MILLISECOND;
198
+
199
+ if (secondsOfDay >= SECONDS_PER_12_HOURS) {
200
+ dayNumber--;
201
+ }
202
+
203
+ var extraDays = (secondsOfDay * ONE_BY_SECONDS_PER_DAY) | 0;
204
+ dayNumber += extraDays;
205
+ secondsOfDay -= SECONDS_PER_DAY * extraDays;
206
+
207
+ if (secondsOfDay < 0) {
208
+ dayNumber--;
209
+ secondsOfDay += SECONDS_PER_DAY;
210
+ }
211
+
212
+ return dayNumber + secondsOfDay * ONE_BY_SECONDS_PER_DAY;
213
+ }
214
+
215
+ /**
216
+ * Converts javascript date to the atomic(TAI) julian date.
217
+ * @param {Date} date - Date.
218
+ * @returns {number} TAI julian date
219
+ */
220
+ export function DateToTAI(date) {
221
+ return UTCtoTAI(DateToUTC(date));
222
+ }
223
+
224
+ /**
225
+ * Converts coordinated universal(UTC) julian date to atomic(TAI) julian date.
226
+ * @param {number} jd - UTC julian date.
227
+ * @returns {number} TAI julian date
228
+ */
229
+ export function UTCtoTAI(jd) {
230
+ var leapSeconds = leapSecondsTable;
231
+
232
+ var index = binarySearch(leapSeconds, jd, function (a, b) {
233
+ return a - b.jd;
234
+ });
235
+
236
+ if (index < 0) {
237
+ index = ~index;
238
+ }
239
+
240
+ if (index >= leapSeconds.length) {
241
+ index = leapSeconds.length - 1;
242
+ }
243
+
244
+ var offset = leapSeconds[index].leapSeconds;
245
+
246
+ if (index !== 0) {
247
+ if ((leapSeconds[index].jd - jd) * SECONDS_PER_DAY > offset) {
248
+ offset = leapSeconds[index - 1].leapSeconds;
249
+ }
250
+ }
251
+
252
+ return jd + offset * ONE_BY_SECONDS_PER_DAY;
253
+ }
254
+
255
+ /**
256
+ * Converts atomic julian date(TAI) to the coordinated universal(UTC) julian date.
257
+ * @param {number} tai - TAI julian date.
258
+ * @returns {number} UTC julian date
259
+ */
260
+ export function TAItoUTC(tai) {
261
+ var leapSeconds = leapSecondsTable;
262
+ var index = binarySearch(leapSeconds, tai, function (a, b) {
263
+ return a - b.jd;
264
+ });
265
+
266
+ if (index < 0) {
267
+ index = ~index;
268
+ }
269
+
270
+ if (index >= leapSeconds.length) {
271
+ return tai - leapSeconds[index - 1].leapSeconds * ONE_BY_SECONDS_PER_DAY;
272
+ }
273
+
274
+ if (index === 0) {
275
+ return tai - leapSeconds[0].leapSeconds * ONE_BY_SECONDS_PER_DAY;
276
+ }
277
+
278
+ var diff = (leapSeconds[index].jd - tai) * SECONDS_PER_DAY;
279
+
280
+ if (diff === 0) {
281
+ return tai - leapSeconds[index].leapSeconds * ONE_BY_SECONDS_PER_DAY;
282
+ }
283
+
284
+ if (diff <= 1.0) {
285
+ return null;
286
+ }
287
+
288
+ return tai - leapSeconds[index - 1].leapSeconds * ONE_BY_SECONDS_PER_DAY;
289
+ }
290
+
291
+ /**
292
+ * Converts UTC julian date to the javascript date object.
293
+ * @param {number} utc - UTC julian date.
294
+ * @returns {Date} JavaScript Date object
295
+ */
296
+ export function UTCtoDate(utc) {
297
+ var julianDayNumber = utc | 0;
298
+ var secondsOfDay = (utc - julianDayNumber) * SECONDS_PER_DAY;
299
+
300
+ if (secondsOfDay >= SECONDS_PER_12_HOURS) {
301
+ julianDayNumber++;
302
+ }
303
+
304
+ var L = (julianDayNumber + 68569) | 0;
305
+ var N = ((4 * L) / 146097) | 0;
306
+ L = (L - (((146097 * N + 3) / 4) | 0)) | 0;
307
+ var I = ((4000 * (L + 1)) / 1461001) | 0;
308
+ L = (L - (((1461 * I) / 4) | 0) + 31) | 0;
309
+ var J = ((80 * L) / 2447) | 0;
310
+ var day = (L - (((2447 * J) / 80) | 0)) | 0;
311
+ L = (J / 11) | 0;
312
+ var month = (J + 2 - 12 * L) | 0;
313
+ var year = (100 * (N - 49) + I + L) | 0;
314
+
315
+ var hour = (secondsOfDay * ONE_BY_SECONDS_PER_HOUR) | 0;
316
+ var remainingSeconds = secondsOfDay - hour * SECONDS_PER_HOUR;
317
+ var minute = (remainingSeconds * ONE_BY_SECONDS_PER_MINUTE) | 0;
318
+ remainingSeconds = remainingSeconds - minute * SECONDS_PER_MINUTE;
319
+ var second = remainingSeconds | 0;
320
+ var millisecond = ((remainingSeconds - second) * MILLISECONDS_PER_SECOND) | 0;
321
+
322
+ hour += 12;
323
+ if (hour > 23) {
324
+ hour -= 24;
325
+ }
326
+
327
+ return new Date(Date.UTC(year, month - 1, day, hour, minute, second, millisecond));
328
+ }
329
+
330
+ /**
331
+ * Converts TAI julian date to the javascript date object.
332
+ * @param {number} tai - TAI julian date.
333
+ * @returns {Date} JavaScript Date object
334
+ */
335
+ export function TAItoDate(tai) {
336
+ var utc = TAItoUTC(tai);
337
+ if (!utc) {
338
+ utc = TAItoUTC(addSeconds(tai, -1));
339
+ console.warn("TAItoDate:336 - can't conv utc.");
340
+ }
341
+
342
+ return UTCtoDate(utc);
343
+ }
344
+
345
+ /**
346
+ * Adds milliseconds to the julian date.
347
+ * @param {number} jd - Julian date.
348
+ * @param {number} milliseconds - Milliseconds to add.
349
+ * @returns {number} Julian date
350
+ */
351
+ export function addMilliseconds(jd, milliseconds) {
352
+ return jd + milliseconds * ONE_BY_MILLISECONDS_PER_DAY;
353
+ }
354
+
355
+ /**
356
+ * Adds seconds to the julian date.
357
+ * @param {number} jd - Julian date.
358
+ * @param {number} seconds - Seconds to add.
359
+ * @returns {number} Julian date
360
+ */
361
+ export function addSeconds(jd, seconds) {
362
+ return jd + seconds * ONE_BY_SECONDS_PER_DAY;
363
+ }
364
+
365
+ /**
366
+ * Adds hours to the julian date.
367
+ * @param {number} jd - Julian date.
368
+ * @param {number} hours - Hours to add.
369
+ * @returns {number} Julian date
370
+ */
371
+ export function addHours(jd, hours) {
372
+ return jd + hours * ONE_BY_HOURS_PER_DAY;
373
+ }
374
+
375
+ /**
376
+ * Adds minutes to the julian date.
377
+ * @param {number} jd - Julian date.
378
+ * @param {number} minutes - Minutes to add.
379
+ * @returns {number} Julian date
380
+ */
381
+ export function addMinutes(jd, minutes) {
382
+ return jd + minutes * MINUTES_PER_DAY;
383
+ }
384
+
385
+ /**
386
+ * Adds days to the julian date.
387
+ * @param {number} jd - Julian date.
388
+ * @param {number} days - Days to add.
389
+ * @returns {number} Julian date
390
+ */
391
+ export function addDays(jd, days) {
392
+ return jd + days;
393
+ }
394
+
395
+ /**
396
+ * Gets milliseconds of a julian date.
397
+ * @param {number} js - julian date.
398
+ * @returns {number} Milliseconds
399
+ */
400
+ export function getMilliseconds(jd) {
401
+ var s = jd - (jd | 0);
402
+ s *= SECONDS_PER_DAY;
403
+ return ((s - (s | 0)) * MILLISECONDS_PER_SECOND) | 0;
404
+ }
405
+
406
+ /**
407
+ * Gets seconds of a julian date.
408
+ * @param {number} js - julian date.
409
+ * @returns {number} Seconds
410
+ */
411
+ export function getSeconds(jd) {
412
+ var s = jd - (jd | 0);
413
+ return s * SECONDS_PER_DAY;
414
+ }
415
+
416
+ /**
417
+ * Gets hours of a julian date.
418
+ * @param {number} js - julian date.
419
+ * @returns {number} Hours
420
+ */
421
+ export function getHours(jd) {
422
+ var julianDayNumber = jd | 0;
423
+ var secondsOfDay = (jd - julianDayNumber) * SECONDS_PER_DAY;
424
+
425
+ var hour = (secondsOfDay * ONE_BY_SECONDS_PER_HOUR) | 0;
426
+ var remainingSeconds = secondsOfDay - hour * SECONDS_PER_HOUR;
427
+ var minute = (remainingSeconds * ONE_BY_SECONDS_PER_MINUTE) | 0;
428
+ remainingSeconds = remainingSeconds - minute * SECONDS_PER_MINUTE;
429
+ var second = remainingSeconds | 0;
430
+ var millisecond = ((remainingSeconds - second) * MILLISECONDS_PER_SECOND) | 0;
431
+
432
+ hour += 12 + minute / 60 + second / 3600 + millisecond / 1000;
433
+ if (hour > 23) {
434
+ hour -= 24;
435
+ }
436
+
437
+ return hour;
438
+ }
439
+
440
+ /**
441
+ * Gets minutes of a julian date.
442
+ * @param {number} js - julian date.
443
+ * @returns {number} Minutes
444
+ */
445
+ export function getMinutes(jd) {
446
+ var s = jd - (jd | 0);
447
+ return (s * MINUTES_PER_DAY) | 0;
448
+ }
449
+
450
+ /**
451
+ * Gets days of a julian date.
452
+ * @param {number} js - julian date.
453
+ * @returns {number} Days
454
+ */
455
+ export function getDays(jd) {
456
+ return jd | 0;
457
+ }
458
+
459
+ /**
460
+ * Returns days in seconds.
461
+ * @param {number} s - Seconds.
462
+ * @returns {number} Days
463
+ */
464
+ export function secondsToDays(s) {
465
+ return s * ONE_BY_SECONDS_PER_DAY;
466
+ }
467
+
468
+ /**
469
+ * Returns seconds in days.
470
+ * @param {number} d - Days.
471
+ * @returns {number} Seconds
472
+ */
473
+ export function daysToSeconds(d) {
474
+ return d * SECONDS_PER_DAY;
475
+ }
476
+
477
+ function __ls(jd, leapSeconds) {
478
+ return {
479
+ jd: jd,
480
+ leapSeconds: leapSeconds
481
+ };
482
+ }
483
+
484
+ const leapSecondsTable = [
485
+ __ls(2441317.5, 10.0), // 1972-01-01T00:00:00.000Z
486
+ __ls(2441499.5, 11.0), // 1972-07-01T00:00:00.000Z
487
+ __ls(2441683.5, 12.0), // 1973-01-01T00:00:00.000Z
488
+ __ls(2442048.5, 13.0), // 1974-01-01T00:00:00.000Z
489
+ __ls(2442413.5, 14.0), // 1975-01-01T00:00:00.000Z
490
+ __ls(2442778.5, 15.0), // 1976-01-01T00:00:00.000Z
491
+ __ls(2443144.5, 16.0), // 1977-01-01T00:00:00.000Z
492
+ __ls(2443509.5, 17.0), // 1978-01-01T00:00:00.000Z
493
+ __ls(2443874.5, 18.0), // 1979-01-01T00:00:00.000Z
494
+ __ls(2444239.5, 19.0), // 1980-01-01T00:00:00.000Z
495
+ __ls(2444786.5, 20.0), // 1981-07-01T00:00:00.000Z
496
+ __ls(2445151.5, 21.0), // 1982-07-01T00:00:00.000Z
497
+ __ls(2445516.5, 22.0), // 1983-01-01T00:00:00.000Z
498
+ __ls(2446247.5, 23.0), // 1985-07-01T00:00:00.000Z
499
+ __ls(2447161.5, 24.0), // 1988-01-01T00:00:00.000Z
500
+ __ls(2447892.5, 25.0), // 1990-01-01T00:00:00.000Z
501
+ __ls(2448257.5, 26.0), // 1991-01-01T00:00:00.000Z
502
+ __ls(2448804.5, 27.0), // 1992-07-01T00:00:00.000Z
503
+ __ls(2449169.5, 28.0), // 1993-07-01T00:00:00.000Z
504
+ __ls(2449534.5, 29.0), // 1994-07-01T00:00:00.000Z
505
+ __ls(2450083.5, 30.0), // 1996-01-01T00:00:00.000Z
506
+ __ls(2450630.5, 31.0), // 1997-07-01T00:00:00.000Z
507
+ __ls(2451179.5, 32.0), // 1999-01-01T00:00:00.000Z
508
+ __ls(2453736.5, 33.0), // 2006-01-01T00:00:00.000Z
509
+ __ls(2454832.5, 34.0), // 2009-01-01T00:00:00.000Z
510
+ __ls(2456109.5, 35.0), // 2012-07-01T00:00:00.000Z
511
+ __ls(2457204.5, 36.0) // 2015-07-01T00:00:00.000Z
512
+ ];
513
+
514
+ export const J2000TAI = UTCtoTAI(J2000);