### Theory:

In a map where locations are represented in coordinates, the distance and the midpoint between two points A (x1,y1) and B (x2,y2) can be calculated with the following algebraic expressions.
$$Distance =$$ $\sqrt{{\left(\mathit{x2}-\mathit{x1}\right)}^{2}+{\left(\mathit{y2}-\mathit{y1}\right)}^{2}}$

$$Midpoint =$$ $\left(\frac{\mathit{x1}+\mathit{x2}}{2},\frac{\mathit{y1}+\mathit{y2}}{2}\right)$
Example:
Find the distance between two points $$A$$ ($$-1$$, $$3$$) and $$B$$ ($$2$$, $$-3$$), and it's midpoint.

Coordinate of $$A$$ is given as ($$-1$$,$$3$$); therefore, we understand that $$x1 = -1$$ and $$y1 = 3$$.

Similarly, the coordinate of $$B$$ is given as ($$2$$,$$-3$$); therefore, we understand that $$x2 = 2$$ and $$y2 = -3$$.

On substituting the coordinates in the given distance expression we get,

$$Distance =$$ $\sqrt{{\left(2-\left(-1\right)\right)}^{2}+{\left(\left(-3\right)-3\right)}^{2}}$

Hence, $$Distance =$$ $$6.7082$$

Similarly, on substituting the coordinates in the given midpoint expression, we get,

$$Midpoint =$$ $\left(\frac{-1+2}{2},\frac{3+\left(-3\right)}{2}\right)$

Hence, $$Midpoint =$$ ($$0.5$$,$$0$$)