# I.

Watch out, here comes some high-school word-problem-style math!Suppose you have a body T (which you intend to be the "rack" part of a rack and pinion) heading left at a constant rate towards a spinny gear thing rotating about the origin. The spinny gear thing has some part P, which you want to eventually strike T at a selected point E. (E being the place where that point right now).

The question we eventually want to answer is:

Where on the gearWe'll call the position of that point at the time of contact "C". You might feel like the problem is underspecified, since maybe P could be free to strike T somewhat earlier or later - it turns out it's not. The important assumptions are that the spinny gear thing is spinning at a constant rate, and the rack is moving to the left at a constant rate.right nowshould we put some speck of mass in P in order to eventually strike body T at our chosen point E by the time it arrives in a suitable place near the gear?

That constant-rate-of-motion-to-the-left of body T

*must*be R distance units per radian of spin for the rack-and-pinion system to behave like the idealized line-and-circle system consisting of the line EB and the radius-R circle centered at the origin. So we know V

_{T}, the velocity of T, (considered as a rate of distance per radian of gear-turn) is the vector (-R, 0). The velocity at the point C on the body P is, well, the standard thing you get from rotational motion; the velocity vector is perpendicular to the line connecting it to the origin of the circle. It's V

_{P}= (y

_{c}, -x

_{c}).

# II.

A critical mechanical constraint about P pushing T around is the following:When P contacts T at point C, the velocity of P relative to T has to be parallel to the tangent line of the two surfaces of P and T along which they are in contact.

(The tangent to T at E is depicted in the diagram by the line EY; the tangent line at the moment of contact is not pictured, but it's parallel to EY and passes through C)

Why does this constraint hold? If V

_{P}- V

_{T}had any velocity perpendicular to the common surface of P and T at the time of contact, then either a split second later (or a split second ago, depending on the sign of the velocity) it would be

*penetrating*the solid body T, and we can't have that. What it means for the relative velocity to be nonzero but parallel to the surface is just that P is (while pushing against T) also slipping in one direction or another. This is mechanically possible and acceptable.

# III.

Q: For which points of contact between P and T can this constraint be satisfied?A:

**On and only on the line YB**, the line that passes through the bottom of the gear's "pitch circle", and which is perpendicular to the slope of body T at the point of contact .

We can see this algebraically: let m be the slope of the body T at the chosen point E. Compute the relative velocity

V

_{P}- V

_{T}= (y

_{c}, -x

_{c}) - (-R, 0)

= (y

_{c}+ R, -x

_{c})

The slope of this velocity vector is -x

_{c}/(y

_{c}+ R). If we set it equal to m, we find

m = -x

_{c}/(y

_{c}+ R)

y

_{c}+ R = (-1/m) x

_{c}

y

_{c}= (-1/m) x

_{c}- R

which is the result we claimed above.

We can also see it to be true geometrically: stare at the diagram and observe that the triangle OCB is related to CV

_{P}V

_{T}by a 90-degree rotation, so the relative velocity vector V

_{P}V

_{T}is perpendicular to the line BC.

# IV.

What do we now know? Given any point-with-derivative (x

_{E}, x

_{E}, m) off in the distance, we know that it must contact the gear at a point on the line

y

_{c}= (-1/m) x

_{c}- R

But clearly y

_{c}= y

_{E}since the rack is just moving horizontally. So we can look back up above at our observation in the previous section that m = -x

_{c}/(y

_{c}+ R) and deduce that x

_{c}= -m(y

_{E}+ R) so we know the contact point C is

(-m(y

_{E}+ R), y

_{E})

Since the rack is moving at a constant rate of R distance per radian, we can find the time of future contact by just computing (x

_{E}- x

_{C}) / R = (x

_{E}+ m(y

_{E}+ R)) / R

radians in the future.

Therefore, to answer the original question, where we should plop some mass down onto the gear

**right now**is whatever you get by taking the contact point (-m(y

_{E}+ R), y

_{E}) and rotating it backwards by (x

_{E}+ m(y

_{E}+ R)) / R radians.

# V.

We somewhat arbitrarily decide that our rack should look like a series of trapezoids where the angle of the slopey bits is chosen arbitrarily, and the height is chosen to be one-half of the "rack pitch", i.e. the period of the periodic function whose graph is the rack.

If we simply take

**every point**of the rack, and apply the above procedure to find a corresponding point on the gear, we get... a gear!

(image link goes to jsfiddle animated rotating gear)

# VI.

But wait, what are the seafoam-green bits?They are for the non-differentiable vertices of the rack shape: for those, we apply the above procedure over just the one point at that vertex, but using

**all of the slopes**intermediate between the slope of the previous line segment, and the slope of the next line segment. These aren't actually involute curves, but they look just like the smooth fillets I'm used to seeing in gear drawings, so I assume I did the right thing there.