Question 536790
Here is the formula for finding the length of the line segment 
connecting two points, regardless of whether the line segment
is horizontal, vertical or slanted:
<pre>
If the points are {{{(matrix(1,3, x[1], ",", y[1]))}}} and {{{(matrix(1,3, x[2], ",", y[2]))}}},
then the length of the line connecting them, which is the same as the distance
between them, is given by this formula:  

d = {{{sqrt( (x[2]-x[1])^2 + (y[2]-y[1])^2 ) }}} 

(1,2),(2,-1),(1,-4),(0,-1)

{{{drawing(400,400,-5,5,-5,5,grid(1),
green(line(0,-1,1,-4),line(1,-4,2,-1),line(1,2,0,-1)),
red(line(2,-1,1,2)),

circle(1,2,.1), circle(2,-1,.1),circle(1,-4,.1),circle(0,-1,.1) )}}}

To find the length of the line segment colored red which connects
the points (1,2) and (2,-1) 

{{{(matrix(1,3, x[1], ",", y[1]))}}} = (1, 2) and {{{(matrix(1,3, x[2], ",", y[2]))}}} = (2, -1)

Substitute those values into this equation:

d = {{{sqrt( (x[2]-x[1])^2 + (y[2]-y[1])^2 ) }}}


d = {{{sqrt( (2-1)^2 + (-1-2)^2 ) }}} = {{{sqrt(1^3+(-3)^2)}}} = {{{sqrt(1+9)}}} = {{{sqrt(10)}}}

You can finish now that you have the right formula.

Edwin</pre>