If you are bored

Started by Shadow, September 09, 2012, 02:09:17 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Calisto

Quote from: Shadow on September 20, 2012, 06:01:13 PM
Quote from: Calisto on September 20, 2012, 04:49:03 PM
This is probably possible to solve by using a couple of math equations. According to the page source, the "cars" move at rates of 9, -11, and 7 pixels per jump (setting left as the positive direction).

If each car is reduced to the size of one pixel, the position can be expressed by a sawtooth function.
p(t) = d ( (v / d)t - floor( (v / d) * t))
d = width of window (pixels)
v = car velocity (pixels/jump)
t = number of jumps (jumps)

I could be wrong though.

You're certainly on the right track. Keep going!
Awesome!

So I guess then that means that the individual position functions would be:
p1(t) = d ( 9t/d - floor(9t/d) )
p2(t) = d ( -11t/d - floor(-11t/d) )
p3(t) = d ( 7t/d - floor(7t/d) )

Measured d = 954 px and timed the period of each car to be 9, 8, and 12 seconds, meaning that the jump rate is about 10 jumps per second. Each holbs-mobile is roughly 50 pixels long.

Putting all of these numbers together in Matlab shows that (on my browser) the cars will align at around jump #478. This corresponds to roughly 47 seconds after the page loads:

This actually occurred 43 seconds after the page loaded, but the difference can be accounted for in the error in measuring the jump rate.

Calisto

Matlab script if you're as crazy as I am and want to calculate it for your own browser:

function cars(width, maxTime, v1, v2, v3, tolerance)

t = 0 : 1 : maxTime;
p1 = width * ( (v1 * t / width) - floor (v1 * t / width));
p2 = width * ( (v2 * t / width) - floor (v2 * t / width));
p3 = width * ( (v3 * t / width) - floor (v3 * t / width));

for i = 1 : maxTime;
    if (abs(p1(i) - p2(i)) < tolerance && abs(p2(i) - p3(i)) < tolerance && abs(p1(i) - p3(i)) < tolerance)
        disp (i);
    end
end

%plot(t, p1, t, p2, t, p3);

end

Camaclue

Quote from: Ungatt Trunn II on November 12, 2012, 09:10:32 PM
ey M8 ur cheeky i swear ill wreck ur [poop]

Shadow

#18
I'm extremely pleased at how this thread turned out

Bonus points - use error propagation formulas to work out if your estimate has a 4s tolerance built in.
<=holbs-.. ..-holbs=> <=holbs-..

Camaclue

Quote from: Ungatt Trunn II on November 12, 2012, 09:10:32 PM
ey M8 ur cheeky i swear ill wreck ur [poop]