rod cutting Algorithm

In making this, it must change the rotary movement of the prime-mover to reciprocating movement for the sucker rod. The pumpjack is the visible above-land drive for the well pump, and is connected to the downhole pump at the bottom of the well by a series of interconnected sucker rods.

rod cutting source code, pseudocode and analysis