[racket-users] Messing with 2htdp/image & universe, got a weird problem

2016-04-10 Thread Wesley Bitomski
Attached is some source code I've been playing with. I'm trying to come up with an approximate simulation of gravity between a very massive (but inertia-less) mouse cursor and a handful of semi-massless circles. For a test, I'm only simulating a single body. This world program will render the f

Re: [racket-users] Messing with 2htdp/image & universe, got a weird problem

2016-04-10 Thread 'John Clements' via Racket Users
> On Apr 10, 2016, at 8:19 AM, Wesley Bitomski > wrote: > > Attached is some source code I've been playing with. I'm trying to come up > with an approximate simulation of gravity between a very massive (but > inertia-less) mouse cursor and a handful of semi-massless circles. > > For a test,

Re: [racket-users] Messing with 2htdp/image & universe, got a weird problem

2016-04-10 Thread Daniel Prager
Hi Wesley Some tips: 1. Your use of random with two args is incorrect: create a (random-range a b) function to express your intent. 2. The slow-down is because you're using unlimited precision arithmetic. Try using 1.0 instead of 1 to get floating point. 3. Instrument your

Re: [racket-users] Messing with 2htdp/image & universe, got a weird problem

2016-04-10 Thread wesley bitomski
Thanks for the advice all! I did re-read the code and realized that it's really not all that descriptive. So I tore through it, made better data definitions, commented the code and profiled it (basically seeing how much time it took to execute each statement); and discovered that my simulation was

Re: [racket-users] Messing with 2htdp/image & universe, got a weird problem

2016-04-10 Thread wesley bitomski
I had just remembered that I forgotten the attachment. After further messing about, I figured that 100 cars provided the best balance of ridiculousness and smoothness. Enjoy! -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from t