Midpoint Formula and Segment Lengths by Variables