Archive for April, 2009

new applet version

Posted in Uncategorized on April 29, 2009 by lightningmonkey

I just posted a new version of the gravity applet that lets you choose if you want to draw short tails, no tails, or draw the full line!  So now you can draw pretty pictures and all that jazz.  I think the next version will allow you to define a path for a well to follow.  On a side note, this is starting to move away from a gravity sim and move more towards an E&M sim, so if I start calling gravity wells magnets, that is why.  Although when you turn on friction it is more of a gravity sim then E&M.  Whatever, we shall see how it turns out!  Once again you can find the applet here.

update:  As my friend pointed out, I couldn’t do anti-gravity, but now I can!! Namely you can put in a negavity well power number so that it repels particles instead of attracting them.


Yay for Gravity!

Posted in Uncategorized on April 27, 2009 by lightningmonkey

So its been a while since I have posted I know, but I have something cool to show.  I made this yesterday instead of doing my homework, a spiffy physics simulation!  The basic premise is that the blue things are gravity wells and the red things are particles.  Each of the particles has a direction and speed while the wells have a magnitude.  At regular intervals each particle 1) figures out the vector between itself and each gravity well 2) calculates the distance between itself and a gravity well 3) divides the well magnitude by distance, multiplies that by the well vector, and adds that resulting vector to its current speed and direction.  So basically this means the particles get attracted to the larger wells more and to the closer wells more then the further away wells.  Makes sense to me.  You can also turn friction on and off, which simply shrinks the current direction vector by a set amount. In addition you can start and stop the simulation, add or take away gravity wells, change the number of particles, and draw a grid so you can place the wells more precisely if you please.  Hope you all have fun with it!