Scalar product of two points coordinates

98 Views Asked by At

In one of the algorithms I encountered an formula to calculate a scalar number from 2 points. Given Point 1 has coordinates $(x1,y1)$ and Point 2 has coordinates $(x2, y2)$ the formula was following

$\sqrt{(y1-x1)^2 + (y2-x2)^2}$

If the $x1$ is equal to $y1$ and $x2$ is equal to $y2$ then the result is $0$. On the other hand the result grows when coordinates are far from the diagonal.

Does this formula has any name or does it serve any well known purpose e.g. in gaming?