# Rotating Wheels and Point Line-up

1. Jul 4, 2015

### r731

Hello all,

I'm trying to obtain solution(s) for problems of the following nature:
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;

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.

2. Jul 4, 2015

### andrewkirk

It's a number theory problem.

It is easy to derive that the first and second wheels line up when and only when the first has performed an integral number of turns - call that number n. For the third wheel to also line up it must have also performed an integral number of turns.

Using the ratios of velocities of the 1st and third wheels, work out how many turns the third wheel must have made when the 1st has made n.

Can that number be an integer, given what is known about pi in number theory?

3. Jul 14, 2015

### r731

Now if pi were replaced by a rational number, say 3.14159, would the initial line-up occur?

How to prove these kinds of stuff?

4. Jul 14, 2015

### andrewkirk

Yes it would occur. Say the angular velocities of the three wheels are $1, \frac{a}{b}, \frac{c}{d}$ where $a,b,c,d$ are integers and $b,d>0$. Then the dots will line up after every $kn$ revolutions of the first wheel where $k$ is any positive integer and $n$ is the least common multiple of $b$ and $d$.

Can you see why?