# Using Python to create a solar system

If anyone is looking for a fun exercise to flex their fingers…

Using just gravitational attraction between bodies, you can create your own 2D solar system with as many stars and planets as you want. Here's a binary star system with some relatively stable planets

Here's the article, including a detailed step-by-step tutorial, if you want to read more: **[Simulating Orbiting Planets in a Solar System Using Python](thepythoncodingbook.com/2021/0)**

…and there's also a 3D version _(next post)_

# 3D Solar System Using Matplotlib

The 3D version uses for the animation

Here's the article: **[Simulating a 3D Solar System In Python Using Matplotlib](thepythoncodingbook.com/2021/1)**

@martinpeck both projects were fun to write (both the code itself and the articles!)

@s_gruppetta I hadn't really thought about using turtle for this sot of thing. It makes perfect sense now I see it!

@martinpeck `turtle` is a fun module to use, beyond the basic _draw a few squares_ type of tutorials you find.

I use it a lot for teaching and I try to push it to its limits and use it to teach more advanced topics, too

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.