The formula for calculating length is:
\(\sqrt{ (x_b-x_a)^{2} + (y_b-y_a)^{2} }\)
We can also write \(x_a - x_b\) or \(y_a - y_b\)
Why it does not matter?
Let's assume we have 2 numbers, a and b.
When we perform a subtraction:
\(a-b\), we get another number \(c\)
When we perform another subtraction:
\(b-a\), we get a number \(-c\)
When we raise \(c\) or \(-c\) to the power of 2, the result is the same, \(c^{2}\).