|
|
So, I worked out a bit of code, and naturally the things I thought might work
didn't, and the half-edited stuff that I just said "aw, heck - lemme just click
the RUN button and see what happens..." works unexpectedly well.
Still some funny business I have to debug.
Of special interest was this:
http://physics.stackexchange.com/questions/245791/explicit-function-for-bouncing-ball?rq=1
though I can't quite seem to get his equation for K to work, because obviously,
E-1 is negative, multiplying that by T doesn't solve that, and then adding 1
doesn't bring it into the positive realm.
So I get a log of negative number! error
Any thoughts what my error in reading / interpreting / coding / implementation
is?
#declare E = 0.75; // (Greek ksi)
#for (T, 0, 25)
#declare K = floor(log( (E-1)*T+1 ) / log(E)); // log [base E] ( (E-1)*T + 1 )
#declare Y = (1/2)*pow(E, K*T) * (T-(pow(E, K*T)-1)/E-1) - (1/2)*pow((T-(pow(E,
K*T)-1)/E-1),2);
sphere {0, 2 pigment {Red} translate <T*10, Y, 0> }
#end
Post a reply to this message
|
|