Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Related Rants
I was writing a simple algorithm to simulate gravity. But when I tested it it produced wildly wrong results. I looked over my whole algorithm trying to find the error, but thought that the last bit, the final position update, must be fine.
I was wrong, some misplaced brackets were accidentally multiplying the position + 0.5 by the sum of the old & new velocity instead of adding the position to 0.5 those velocities.
I noticed that and fixed it, and now it runs pretty well.
undefined
wk8
gravity simulator
bracket