mirror of
https://gitlab.com/Anson-Projects/projects.git
synced 2025-09-16 10:35:04 +00:00
checkpoint, idk what is going on here anymore
This commit is contained in:
78
posts/2024-12-25-moon-cannon-duece/index.quarto_ipynb
Normal file
78
posts/2024-12-25-moon-cannon-duece/index.quarto_ipynb
Normal file
@@ -0,0 +1,78 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"---\n",
|
||||
"title: \"Moon Cannon: dos\"\n",
|
||||
"description: |\n",
|
||||
" Can you shoot Earth from the Moon? Simulate lunar ballistic launches with Julia. Explore orbital mechanics, gravity, and drag in a simplified Moon-to-Earth cannon model.\n",
|
||||
"date: 2024-09-25\n",
|
||||
"categories:\n",
|
||||
" - Julia\n",
|
||||
" - Astrodynamics\n",
|
||||
" - Code\n",
|
||||
" - Aerospace\n",
|
||||
" - Space\n",
|
||||
" - Math\n",
|
||||
"draft: false\n",
|
||||
"freeze: false\n",
|
||||
"image: moon_spirograph.png\n",
|
||||
"---"
|
||||
],
|
||||
"id": "e623b02d"
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"using SPICE\n",
|
||||
"\n",
|
||||
"const LSK = \"https://naif.jpl.nasa.gov/pub/naif/generic_kernels/lsk/naif0012.tls\"\n",
|
||||
"const SPK = \"https://naif.jpl.nasa.gov/pub/naif/generic_kernels/spk/planets/de440.bsp\"\n",
|
||||
"\n",
|
||||
"# Download kernels\n",
|
||||
"download(LSK, \"naif0012.tls\")\n",
|
||||
"download(SPK, \"de440.bsp\")\n",
|
||||
"\n",
|
||||
"# Load leap seconds kernel\n",
|
||||
"furnsh(\"naif0012.tls\")\n",
|
||||
"\n",
|
||||
"# Load a planetary ephemeris kernel\n",
|
||||
"furnsh(\"de440.bsp\")\n",
|
||||
"\n",
|
||||
"function get_planet_positions(epoch)\n",
|
||||
" planets = [\"MERCURY\", \"VENUS\", \"EARTH\", \"MARS\", \n",
|
||||
" \"JUPITER\", \"SATURN\", \"URANUS\", \"NEPTUNE\"]\n",
|
||||
" positions = Dict()\n",
|
||||
"\n",
|
||||
" for planet in planets\n",
|
||||
" # Get position vector in km relative to Sun\n",
|
||||
" pos, _ = spkpos(planet, epoch, \"J2000\", \"NONE\", \"earth\")\n",
|
||||
" positions[planet] = pos\n",
|
||||
" end\n",
|
||||
"\n",
|
||||
" return positions\n",
|
||||
"end\n",
|
||||
"\n",
|
||||
"# Example usage (epoch in UTC)\n",
|
||||
"epoch = \"1995-12-17T12:00:00\" |> utc2et\n",
|
||||
"positions = get_planet_positions(epoch)"
|
||||
],
|
||||
"id": "72207da4",
|
||||
"execution_count": null,
|
||||
"outputs": []
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"name": "julia-1.11",
|
||||
"language": "julia",
|
||||
"display_name": "Julia 1.11.1",
|
||||
"path": "/root/.local/share/jupyter/kernels/julia-1.11"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 5
|
||||
}
|
Reference in New Issue
Block a user