-
Notifications
You must be signed in to change notification settings - Fork 0
/
about.html
300 lines (279 loc) · 12.9 KB
/
about.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Solar System Orrery</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 20px;
background-color: #f4f4f4;
color: #333;
}
h1 {
text-align: center;
color: #2c3e50;
}
.container {
max-width: 800px;
margin: 0 auto;
background: white;
padding: 20px;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
p {
line-height: 1.6;
margin: 15px 0;
}
a {
color: #2980b9;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
.math {
text-align: center;
margin: 20px 0;
}
footer {
text-align: center;
margin-top: 40px;
font-size: 0.9em;
color: #777;
}
</style>
<script type="text/javascript" id="MathJax-script" async
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js">
</script>
</head>
<body>
<h1>Solar System Orrery</h1>
<div class="container">
<p>This is a solar system orrery based on mathematical formulas and the NASA Near Earth Comets API. The planets are displayed using their heliocentric coordinates (x, y, z). The animation is created by moving frames of plotted planets.</p>
<p>To calculate the planet positions, the formulas from the excellent Astronomy Answers website were used: <a href="https://aa.quae.nl/en/reken/hemelpositie.html">Sun Position Answers</a>.</p>
<p>In astronomy, Julian Dates are frequently used. To calculate the Julian date, we borrowed code from this tutorial: <a href="https://jasonsturges.medium.com/moons-lunar-phase-in-javascript-a5219acbfe6e">Moon's Lunar Phase</a>.</p>
<p>Each planet has a mean anomaly, which indicates its position in its orbit. With the Julian Date calculated earlier, the mean anomaly can be obtained. The mean anomaly can be calculated as:</p>
<div class="math">
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mtable displaystyle="true">
<mlabeledtr>
<mtd id="mjx-eqn-5">
<mtext>(5)</mtext>
</mtd>
<mtd>
<mi>M</mi>
<mo>=</mo>
<msub>
<mi>M</mi>
<mn>0</mn>
</msub>
<mo>+</mo>
<mi>n</mi>
<mo stretchy="false">(</mo>
<mi>d</mi>
<mo>−</mo>
<msub>
<mi>d</mi>
<mn>0</mn>
</msub>
<mo stretchy="false">)</mo>
</mtd>
</mlabeledtr>
</mtable>
</math>
</div>
<p>More information about the calculation of the mean anomaly can be found in step 2 of <a href="https://www.aa.quae.nl/en/reken/zonpositie.html">Solar Position</a>.</p>
<p>After obtaining the mean anomaly, the simulation calculates the equation of center (a corrective coefficient for the mean anomaly), and adds it to the mean anomaly of the planet to obtain the <i>true anomaly</i>, which is a more accurate measure. More information about calculating the equation of center and obtaining the true anomaly can be found in steps 2-3 in <a href="https://www.aa.quae.nl/en/reken/zonpositie.html">Solar Position</a>.</p>
<p>With the mean anomaly and some coefficients that can be obtained from tables 1 and 2 on this page: <a href="https://www.aa.quae.nl/en/reken/hemelpositie.html">Positions in the Sky</a>, the distance to the sun (from the planet) can be calculated via this formula:</p>
<div class="math">
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mtable displaystyle="true">
<mlabeledtr>
<mtd id="mjx-eqn-6">
<mtext>(6)</mtext>
</mtd>
<mtd>
<mi>r</mi>
<mo>=</mo>
<mfrac>
<mrow>
<mi>a</mi>
<mo stretchy="false">(</mo>
<mn>1</mn>
<mo>−</mo>
<msup>
<mi>e</mi>
<mn>2</mn>
</msup>
<mo stretchy="false">)</mo>
</mrow>
<mrow>
<mn>1</mn>
<mo>+</mo>
<mi>e</mi>
<mi>cos</mi>
<mo data-mjx-texclass="NONE">⁡</mo>
<mrow>
<mo>ν</mo>
</mrow>
</mrow>
</mfrac>
</mtd>
</mlabeledtr>
</mtable>
</math>
</div>
<p>Afterwards, we used these formulas to calculate the heliocentric coordinates of the planets:</p>
<div class="math">
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mtable displaystyle="true" columnalign="right left right left right left right left right left right left" columnspacing="0em 2em 0em 2em 0em 2em 0em 2em 0em 2em 0em" rowspacing="3pt">
<mlabeledtr>
<mtd id="mjx-eqn-7">
<mtext>(7)</mtext>
</mtd>
<mtd>
<msub>
<mi>x</mi>
<mtext>planet</mtext>
</msub>
</mtd>
<mtd>
<mo>=</mo>
<mi>r</mi>
<mo stretchy="false">(</mo>
<mi>cos</mi>
<mo data-mjx-texclass="NONE">⁡</mo>
<mrow>
<mo>Ω</mo>
</mrow>
<mi>cos</mi>
<mo data-mjx-texclass="NONE">⁡</mo>
<mo stretchy="false">(</mo>
<mrow>
<mo>ω</mo>
</mrow>
<mo>+</mo>
<mrow>
<mo>ν</mo>
</mrow>
<mo stretchy="false">)</mo>
<mo>−</mo>
<mi>sin</mi>
<mo data-mjx-texclass="NONE">⁡</mo>
<mrow>
<mo>Ω</mo>
</mrow>
<mi>cos</mi>
<mo data-mjx-texclass="NONE">⁡</mo>
<mi>i</mi>
<mi>sin</mi>
<mo data-mjx-texclass="NONE">⁡</mo>
<mo stretchy="false">(</mo>
<mrow>
<mo>ω</mo>
</mrow>
<mo>+</mo>
<mrow>
<mo>ν</mo>
</mrow>
<mo stretchy="false">)</mo>
<mo stretchy="false">)</mo>
</mtd>
</mlabeledtr>
<mlabeledtr>
<mtd id="mjx-eqn-8">
<mtext>(8)</mtext>
</mtd>
<mtd>
<msub>
<mi>y</mi>
<mtext>planet</mtext>
</msub>
</mtd>
<mtd>
<mo>=</mo>
<mi>r</mi>
<mo stretchy="false">(</mo>
<mi>sin</mi>
<mo data-mjx-texclass="NONE">⁡</mo>
<mrow>
<mo>Ω</mo>
</mrow>
<mi>cos</mi>
<mo data-mjx-texclass="NONE">⁡</mo>
<mo stretchy="false">(</mo>
<mrow>
<mo>ω</mo>
</mrow>
<mo>+</mo>
<mrow>
<mo>ν</mo>
</mrow>
<mo stretchy="false">)</mo>
<mo>+</mo>
<mi>cos</mi>
<mo data-mjx-texclass="NONE">⁡</mo>
<mrow>
<mo>Ω</mo>
</mrow>
<mi>cos</mi>
<mo data-mjx-texclass="NONE">⁡</mo>
<mi>i</mi>
<mi>sin</mi>
<mo data-mjx-texclass="NONE">⁡</mo>
<mo stretchy="false">(</mo>
<mrow>
<mo>ω</mo>
</mrow>
<mo>+</mo>
<mrow>
<mo>ν</mo>
</mrow>
<mo stretchy="false">)</mo>
<mo stretchy="false">)</mo>
</mtd>
</mlabeledtr>
<mlabeledtr>
<mtd id="mjx-eqn-9">
<mtext>(9)</mtext>
</mtd>
<mtd>
<msub>
<mi>z</mi>
<mtext>planet</mtext>
</msub>
</mtd>
<mtd>
<mo>=</mo>
<mi>r</mi>
<mi>sin</mi>
<mo data-mjx-texclass="NONE">⁡</mo>
<mi>i</mi>
<mi>sin</mi>
<mo data-mjx-texclass="NONE">⁡</mo>
<mo stretchy="false">(</mo>
<mrow>
<mo>ω</mo>
</mrow>
<mo>+</mo>
<mrow>
<mo>ν</mo>
</mrow>
<mo stretchy="false">)</mo>
</mtd>
</mlabeledtr>
</mtable>
</math>
</div>
<p>After repeating these steps for each planet, the heliocentric coordinates (x, y, z) are obtained for each of the planets. Considering the center of the sun as the center of the solar system (0, 0, 0), we can now plot and animate the planets. For comets, a very similar approach was used. Data was obtained from this NASA API website: <a href="https://data.nasa.gov/api-documents/foundry/#/data.nasa.gov/b67r-rgxc">Comet API</a>, and the heliocentric coordinates for each planet were calculated. In the same way, the comets were plotted in the simulation.</p>
</div>
<footer>
© 2024 Solar System Orrery Project
</footer>
</body>
</html>