Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Readme.md

Galaxy Simulation

Hey! 👋
This is a simple Python script that creates a cool spiral galaxy animation using matplotlib and numpy. You’ll see thousands of stars spinning around, kinda like what you’d imagine a galaxy looks like from space.

What does it do?

  • Generates 3000 stars with random positions and colors
  • Arranges them in spiral arms (like a real galaxy)
  • Animates the stars so they rotate around the center
  • Shows a bright yellow core in the middle

How to run it

  1. Make sure you have Python installed (I used Python 3.12, but anything recent should work).

  2. You’ll need matplotlib and numpy. If you don’t have them, just run this in your terminal:

    pip install matplotlib numpy
    
  3. Run the script:

    python galaxy.py
    
  4. The animation window should pop up. If it doesn’t, check your Python and matplotlib install.

Why did I make this?

I just thought galaxies are awesome and wanted to see if I could make one with code. It’s also a fun way to mess around with numpy and matplotlib animations.

Can I use this?

Yeah, go for it! Tweak the numbers, change the colors, make it your own. If you make something cooler, let me know 😄