Apply the Pythagorean theorem to find the distance between two points in a coordinator system

Using pythagoras theorem to find the distance between two points in a coordinate:
[tex]\begin{gathered} A=(-5,5) \\ B=(-1,1) \end{gathered}[/tex][tex]\begin{gathered} A=(-5,5)\longrightarrow x_1=-5,y_1=5 \\ B=(-1,1)\longrightarrow x_2=-1,y_2=1 \\ \text{vertical line = opposite =5-1=4} \\ \text{horizontal line = adjacent = -5--1=-5+1=-4} \end{gathered}[/tex]To calculate the distance between the points AB = hypotenuse
[tex]\begin{gathered} \text{Hypotenuse}^2=opposite^2+adjacent^2 \\ AB^2=4^2+(-4)^2 \\ AB^2=16+16 \\ AB^2=32 \\ AB=\sqrt[]{32} \\ AB=4\sqrt[]{2} \end{gathered}[/tex]Therefore the distance between the points in the coordinate system = 4√2