Re: So I tried to see if I could do something like GSim in J
Posted: Sat Jul 11, 2015 6:07 pm
For some reason this didn't work, and that was the first thing I tried... hmm... I'll figure it out.testtubegames wrote: For merging, you just need to worry about (a) Conservation of Mass, and (b) Conservation of Momentum (mass*velocity). So make sure the new planet has the sum of the old masses (which I imagine you're already doing). And then sum up the momenta before, and use that to figure out the momentum (and thus velocity) afterwards.
DOH! Haha, neat-o. I'll definitely work on this.A Random Player wrote: True! You just need to remember that cos = x/d, and sin = y/d (soh-cah-toa anyone?), and replace it. So in general,
vx += x / d * f(d)
vy += y / d * f(d) Also Andy has a tweet's characters more than twice my post count - 828 vs 484. Also the digits are all powers of 2, and mine is 22^2!