The total circuit length is a round trip so half the circuit length is the distance between the two items (panels, boxes, etc.)
To add to the complexity, there are different rules for wires hung in free air (such as overhead) versus wires in Romex cables or buried or in conduit. And a further calculation, called derating, for several circuits' worth or wires running juxtaposed. The rule of 14 gauge for up to 15 amps and 12 gauge for up to 20 amps is for wires within cables running singly.
It is difficult to shop locally when the locality slaps you with a fine if you are a little slow getting back to your car.