The distance formula, d= √ (x2-x1)^2+(y2-y1)^2, is the key element in the proof of which of the following?
A: The law of cosines
B: CPCTC
C: The law of sines
D: The triangle inequality theorem