{"id":24762021,"url":"https://github.com/thomasafink/orbital-mechanics","last_synced_at":"2026-05-02T15:38:51.623Z","repository":{"id":273225783,"uuid":"894671120","full_name":"ThomasAFink/orbital-mechanics","owner":"ThomasAFink","description":"A comprehensive 3D visualization of our solar system including planets, moons, asteroid belts, and the Oort cloud implemented in Python using Matplotlib.","archived":false,"fork":false,"pushed_at":"2025-01-19T15:27:30.000Z","size":62,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-28T19:20:31.292Z","etag":null,"topics":["asteroid-belt","asteroids","astro","astrophysics","nasa","orbital-dynamics","orbital-mechanics","orbits","physics","python","simulation","solar","solar-system","space","system"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ThomasAFink.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-26T19:16:03.000Z","updated_at":"2025-01-19T15:27:31.000Z","dependencies_parsed_at":"2025-01-19T16:27:28.285Z","dependency_job_id":"6b549a96-8b9b-4c7e-851b-f90b773288f3","html_url":"https://github.com/ThomasAFink/orbital-mechanics","commit_stats":null,"previous_names":["thomasafink/orbital-mechanics"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThomasAFink%2Forbital-mechanics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThomasAFink%2Forbital-mechanics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThomasAFink%2Forbital-mechanics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThomasAFink%2Forbital-mechanics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ThomasAFink","download_url":"https://codeload.github.com/ThomasAFink/orbital-mechanics/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245104526,"owners_count":20561380,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asteroid-belt","asteroids","astro","astrophysics","nasa","orbital-dynamics","orbital-mechanics","orbits","physics","python","simulation","solar","solar-system","space","system"],"created_at":"2025-01-28T19:20:14.054Z","updated_at":"2026-05-02T15:38:51.572Z","avatar_url":"https://github.com/ThomasAFink.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Solar System 3D Animation\n\nA comprehensive 3D visualization of our solar system including planets, moons, asteroid belts, and the Oort cloud implemented in Python using Matplotlib.\n\n\u003cimg width=\"100%\" alt=\"Screenshot 2025-01-19 at 15 32 35\" src=\"https://github.com/user-attachments/assets/3beb28dd-457a-4fcb-b41a-de6aa0a573dc\" /\u003e\n\n\n## Features\n\n- Full 3D representation of the solar system\n- Accurate orbital mechanics based on Kepler's laws\n- Includes all planets and major moons\n- Visualization of:\n  - Asteroid Belt\n  - Hildas Group\n  - Jupiter Trojans\n  - Kuiper Belt\n  - Inner Oort Cloud (Hills Cloud)\n  - Outer Oort Cloud\n- Dynamic camera with smooth zoom\n- Multiple output formats (GIF, 1080p MP4, 4K MOV)\n- Light and dark theme options\n\n## Mathematical Physics\n\n### Orbital Mechanics\n\nThe simulation uses Kepler's laws of planetary motion to calculate orbital positions:\n\n1. **Kepler's First Law**: Orbits are elliptical with the Sun at one focus\n   ![equation](https://latex.codecogs.com/png.latex?r=\\frac{a(1-e^2)}{1+e\\cos\\theta})\n   where:\n   - r = distance from the sun\n   - a = semi-major axis\n   - e = eccentricity\n   - θ = true anomaly\n\n2. **Kepler's Second Law**: Equal areas are swept in equal times\n   ![equation](https://latex.codecogs.com/png.latex?\\frac{dA}{dt}=\\frac{1}{2}r^2\\frac{d\\theta}{dt}=constant)\n\n3. **Kepler's Third Law**: The square of the orbital period is proportional to the cube of the semi-major axis\n   ![equation](https://latex.codecogs.com/png.latex?T^2=\\frac{4\\pi^2}{GM}a^3)\n\n### 3D Position Calculation\n\nThe position of celestial bodies is calculated using:\n\n```mermaid\ngraph TD\n    A[Orbital Elements] --\u003e B[Calculate in Orbital Plane]\n    B --\u003e C[Apply Inclination]\n    C --\u003e D[Apply Ascending Node]\n    D --\u003e E[Final 3D Position]\n```\n\nPosition calculation formula:\n![equation](https://latex.codecogs.com/png.latex?%5Cbegin%7Bpmatrix%7D%20x%20%5C%5C%20y%20%5C%5C%20z%20%5Cend%7Bpmatrix%7D%20%3D%20%5Cbegin%7Bpmatrix%7D%20%5Ccos%5COmega%20%26%20-%5Csin%5COmega%5Ccos%20i%20%5C%5C%20%5Csin%5COmega%20%26%20%5Ccos%5COmega%5Ccos%20i%20%5C%5C%200%20%26%20%5Csin%20i%20%5Cend%7Bpmatrix%7D%20%5Cbegin%7Bpmatrix%7D%20r%5Ccos%5Ctheta%20%5C%5C%20r%5Csin%5Ctheta%20%5Cend%7Bpmatrix%7D)\n\nWhere:\n- Ω = ascending node\n- i = inclination\n- r = orbital radius\n- θ = orbital angle\n\n## System Architecture\n\n```mermaid\nclassDiagram\n    class Config {\n        +SETTINGS: dict\n        +frames: int\n        +camera_distance: float\n        +planets: dict\n        +asteroid_counts: dict\n    }\n    class SolarSystemAnimation3D {\n        +init_positions()\n        +update(frame)\n        +calculate_3d_position()\n        +calculate_visibility()\n        +animate()\n        +save()\n        +save1080p()\n        +save4k()\n    }\n    Config -- SolarSystemAnimation3D\n```\n\n## Requirements\n\n- Python 3.7+\n- NumPy\n- Matplotlib\n- FFmpeg (for video output)\n\n## Installation\n\n```bash\npip install numpy matplotlib\n# For video output\napt-get install ffmpeg  # Linux\nbrew install ffmpeg    # macOS\n```\n\n## Usage\n\nBasic usage:\n\n```python\nfrom complete_solar_system_3d import SolarSystemAnimation3D\n\n# Create animation\nsolar_system = SolarSystemAnimation3D(style='default')\n\n# Display animation\nsolar_system.animate()\n\n# Save as GIF\nsolar_system.save(\"solar_system.gif\")\n\n# Save as 1080p video\nsolar_system.save1080p(\"solar_system_1080p.mp4\")\n\n# Save as 4K video\nsolar_system.save4k(\"solar_system_4k.mov\")\n```\n\n## Customization\n\nYou can modify the Config.SETTINGS dictionary to:\n- Adjust animation frames\n- Change camera behavior\n- Modify planet/moon properties\n- Adjust asteroid population sizes\n\n## Performance Notes\n\n- The animation is computationally intensive, especially with large asteroid populations\n- 4K rendering requires significant memory and processing power\n- Consider reducing asteroid counts for smoother performance\n\n## License\n\nMIT License - feel free to use and modify for your own projects!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthomasafink%2Forbital-mechanics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthomasafink%2Forbital-mechanics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthomasafink%2Forbital-mechanics/lists"}