- #1

r731

- 40

- 6

I'm trying to obtain solution(s) for problems of the following nature:

Suppose there were three wheels of equal size, rotating on the same axis, one point marked on the circumference of each wheel, and these three points lined up in one straight line. If the second wheel rotated twice as fast as the first, and if the speed of the third wheel was 1/π of the speed of the first, the initial line-up would never recur.

To keep things simple, I begin with two wheels instead, A and B.

If A has the frequency f_A, and B f_B, then the location (in terms of degrees) of each marked point is computed as follows:

**f_A * 360 * t % 360;**

f_B * 360 * t % 360;

f_B * 360 * t % 360;

where t is the elapsed time.

And,

360*f_A - 360*floor(f_A*t) = 360*f_B - 360*floor(f_B*t),

which simplifies to,

**f_A - floor(f_A*t) = f_B - floor(f_B*t)**

can be solved for t; the solutions of which represent the time instants during which the two points (each of which is marked on one wheel) line up.

Is there any simpler way other than using %-operator and floor()?

I was especially thinking of graphs plotted on a coordinate system, where the intersection points would be solutions.

Thanks in advance.