# Scalar product of two points coordinates

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?

• Pythagorean theorem – caverac Jan 10 at 21:25
• Nope. Check the coordinates.... Oh, and this has nothing to do with "scalar product." – David G. Stork Jan 10 at 21:26
• @caverac But Pytagorean hypothenuse whould be $\sqrt{(x1-x2)^2+(y1-y2)^2}$ – nosalan Jan 10 at 21:36
• You're right, I misread the variables. Are you sure this is the right expression? – caverac Jan 10 at 23:51
• Some context for this expression would be helpful. – amd Jan 11 at 0:50