Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Cog $A$ is at position: $Ax$, $Ay$, rotation: $Ar$ and number of teeth: $At$

Cog $B$ is at position: $Bx$, $By$ and number of teeth $Bt$. What is Cog $B$'s rotation such that teeth between Cog $A$ and Cog $B$ line up. There will be the same number of answers as there are teeth, but a 'base angle' is desired.

cog diagram

share|cite|improve this question
Image here: – sq2 Jul 15 '12 at 3:50

You can calculate the angle $\alpha$ of the line from $A$ to $B$ as $\alpha=\arctan\frac{By-Ay}{Bx-Ax}$. You want the phases to be opposite at this angle, so $(\alpha-Ar)At=(\alpha+\pi-Br)Bt+\pi+ 2\pi n$, with $n$ an integer; you can solve this for $Br$ to determine $Br$ up to integer multiples of $2\pi/Bt$.

share|cite|improve this answer
@sq2: Then it would be great if you'd write it up as an answer; then your question wouldn't remain unanswered, and we could compare our solutions. – joriki Jul 17 '12 at 11:41

The solution I have found, which may be @joriki's solution expressed in a different format:

Angle α is of course required, see @joriki's solution.

Br = At / Bt * -Ar + α * (At + Bt) / Bt

and if Bt is even, add π / Bt to Br

share|cite|improve this answer
Here's proof: – sq2 Jul 17 '12 at 12:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.