>>1707141The size is theoretically the seattube length, not top tube, but if it is top tube it should be "effective" top tube, not literal, which is middle of the headtube at the junction with the top tube to the middle of the seattube/post measured parallel to the ground.
Here's Trek's size chart with some frame measurements you can use to get a better idea of the 'real' size, but anything with an 18 inch seattube shouldn't be too big for anyone who isn't a literal midget. In the drops with your forearms parallel to the ground your elbows should be roughly 90 degrees.
Also why do I have to do a contour integral to know the fork size?