Saturday, 17 November 2007

Friday night, is physics and Python night

It's Friday night, you don't have anything to do. Well, you could of course work. But after working hard for more than a week and not even having a weekend last weekend you don't want to do that. Besides, your studies and your employer must let you have some fun.

What I did was dig up Python, some upper secondary school physics and my Fundamentals of Physics (as I am a CS student I have only taken one course in physics at university level) and started to hack some code. Planetary orbits and gravity, I thought, could look rather nice when simulated. So a few hours later I have constructed a small program that simulates the effects of gravity.


What you see is a "sun", well, it's really just a much bigger astral body (just like a sun) and some smaller planets moving in orbits around it. The lines represent gravity vectors, speed vectors, acceleration vectors and so on. They are just there to help me debug the whole thing.

It has been a rather nice Friday night in my opinion. Perhaps I should hack a little more on the concept, who knows. Now I will get some sleep and tomorrow it's all school work and work again.

No comments: