For horizontal lines and vertical lines the distance is determined by checking their difference. This formula has been derived from the Pythagorean Theorem. The Distance Formula is a variant of the Pythagorean Theorem that you used back in geometry.
The Distance Formula squares the differences between the two x coordinates and two y coordinates then adds those squares and finally takes their square root to get the total distance along the diagonal line.
Start color 11accd start text d i s t a n c e end text end color 11accd. Find the distance between -1 1 and 3 4. Given two points x 1 y 1 x 2 y 2 the formula for distance is calculated with the following formula. Start color 11accd start text d i s t a n c e end text end color 11accd.