Its a ratio thing,
(dist1 / tot dist) so get horizontal distance between end points and the distance from say start point to point, in XY plane.
height of end points
So ((Ht1 - Ht2) * dist ratio) + ht1.
Check with calculator.
Why are you asking, take the broken one to a good machine shop and they will work out what it is very quick. If your thinking just 3D print one it may not last. A lot of pressure in those paper shredder gears, by people who put 5 sheets in when sign says max 3.