Flat Belts

Problem #36

Tags: geometry apollonius

Who solved this?

Previous:Blocked View Next:A Fence and Four Boulders


Modern factories require power to run their equipment. In the 21st century, the easiest solution is often electricity which is run through cables to reach each machine. However for factories in the early 19th century at the beginning of the industrial revolution, powering their machinery with electricty wasn't an option. Instead, factories made use of Line Shafts - long spinning rods suspended overhead the work area which were powered by some source such as a water wheel. The energy of these spinning Line Shafts would then be harnessed at each individual machine, by a system of gears which could be engaged to run the machine.

This system worked well for distributing power through a factory, but the abundance of working gears meant that constant precision maintenance was required to keep gears lubricated, properly aligned, and free from damage. In 1824 in Lowell, Masachusetts, Paul Moody invented a similar system which instead used Flat Belts to transfer power from the Line Shaft to each machine. These Flat Belts were much easier to create and maintain, and the design quickly spread across American factories for the remainder of the century.

The Claybank Brick Plant in Saskatchewan, with many Flat Belts attached to the Line Shaft.

Let's imagine we have a machine ready to be supplied with power in a 19th-century factory, and so we need to create a Flat Belt to attach it to the Line Shaft. We know the radius of the Line Shaft, the radius of the Pulley where the belt attaches to the machine itself, and also the positions of both the Line Shaft and the Pulley. If we want our belt to be tight without any sagging, how long does the belt need to be?

Flat Belt

A Flat Belt connecting a Line Shaft to a Pulley.

Assume that the Flat Belts used for this problem have no thickness, and are perfectly tight with no sagging.

Problem Statement

Input Data
The first line will be Q, the quantity of testcases.
Q lines will then follow, each with six space-separated values in the format Sx Sy Sr Px Py Pr, where (Sx, Sy) are the coordinates of the center of the Line Shaft, Sr is the radius of the Line Shaft, (Px, Py) are the coordinates of the center of the Pulley, and Pr is the radius of the Pulley.

Answer
Should consist of Q space-separated values corresponding to the length of the Flat Belt required to connect the Line Shaft to the Pulley in each testcase.
Error should be less than 1e-4.

Example

input data:
2
1 2 1 3 5 1
1 2 1 93 95 91

answer:
13.494 615.468
You need to login to get test data and submit solution.