Differences between revisions 3 and 4
Revision 3 as of 2025-09-24 13:02:19
Size: 1933
Comment: Moving vector pages
Revision 4 as of 2025-09-24 13:39:20
Size: 1934
Comment: Rewrite
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
## page was renamed from LinearAlgebra/Distance
Line 4: Line 3:
'''Euclidean distance''' in higher dimensional space is useful for normalization. '''Distance''' is one of the two fundamental components of [[Calculus/VectorOperations|vectors]].
Line 12: Line 11:
== 2 Dimensions == == Pythagorean distance ==
Line 14: Line 13:
In 2 dimensions, the distance between two Cartesian points is calculated by the '''Pythagorean theorem''': ''x^2^ + y^2^ = z^2^''. This is sometimes referred to as the '''Pythagorean distance'''. In ''R^2^'' space, the distance between two Cartesian points is calculated by the '''Pythagorean theorem''': ''x^2^ + y^2^ = z^2^''.
Line 16: Line 15:
When this concept is expanded to complex numbers (but still in 2 dimensions), a common notation is ''|x - y|'' to emphasize that the distance must be normalized to an absolute value.
The Pythagorean distance of a vector a⃗ is notated ''|a⃗|''.
Line 23: Line 21:
== n Dimensions == == Euclidean distance ==
Line 25: Line 23:
For a singular vector ''x'', the distance is the sum of each components' absolute value. If ''x'' is ''[1 2 3]'' or ''[-1 -2 -3]'', the distance of ''x'' is 6. Note that distance of a vector ''x'' is notated as ''||x||''. Euclidean distance is the expansion of Pythagorean distance into ''R^n^'' space. Although [[Calculus|vector calculus]] largely stays in ''R^3^'', this property is generalized for higher dimensions.
Line 27: Line 25:
The Pythagorean theorem continues to hold in higher dimensions. Note that the theorem calls for squared distances: ''x^2^''. In other words, the squared distance of ''x'' is the sum of each component squared. For either of those ''x'' vectors, the squared distance is 14. Recall though that in matrix notation, multiplying two vectors creates a matrix; true vector multiplication is notated as ''x^T^x''. The squared Euclidean distance is the sum of squares across all components of the vector. For vector a⃗ with ''i'' components, this could be written out as ''Σa,,i,,''. In [[LinearAlgebra|linear algebra]] however, the more conventional expression is ''x^T^x'' for a given vector ''x''.
Line 29: Line 27:
Plugging this into the Pythagorean theorem then, if ''y'' were ''[2 -1 0]'' (with squared distance of 5), then the squared distance of ''z'' is 19. The actual distance is √19. Taking the square root then gives the actual Euclidean distance, which for a vector a⃗ is notated ''||a⃗||''.
Line 31: Line 29:
This can be double checked using the given values of ''x'' and ''y'', because vectors can be added directly. ''x + y = z'', so ''[1 2 3] + [2 -1 0] = [3 1 3]''. And with that calculated ''z'', it's clear again that the squared distance of ''z'' is 19. This can be proven in ''R^3^'' trivially. For a vector a⃗ with X, Y, and Z components, use the Pythagorean theorem on the X and Y components to calculate a hypotenuse vector. Then use it again with that hypotenuse vector and the Z component.
Line 33: Line 31:
For two vectors ''x'' and ''y'', the Pythagorean theorem can be written as ''x^T^x + y^T^y = (x+y)^T^(x+y)''. This formulation leads to the test for [[LinearAlgebra/Orthogonality#Vectors|orthogonality]]. More generally, the Pythagorean theorem can be shown to hold in ''R^n^'' space. Suppose that ''x'' is ''[1 2 3]'' and ''y'' is ''[2 -1 0]''. [[Calculus/VectorOperations#Addition|Vector addition]] demonstrates that ''z = x + y = [1 2 3] + [2 -1 0] = [3 1 3]''. The Pythagorean theorem would then suggest that ''x^T^x + y^T^y = z^T^z''; and it is straightforward to demonstrate that both the left and right hand sides of the equation are ''19''.

The Pythagorean theorem can be restated as ''x^T^x + y^T^y = (x+y)^T^(x+y)''. This formulation leads to the test for [[LinearAlgebra/Orthogonality#Vectors|orthogonality]].

Distance

Distance is one of the two fundamental components of vectors.


Pythagorean distance

In R2 space, the distance between two Cartesian points is calculated by the Pythagorean theorem: x2 + y2 = z2.

The Pythagorean distance of a vector a⃗ is notated |a⃗|.


Euclidean distance

Euclidean distance is the expansion of Pythagorean distance into Rn space. Although vector calculus largely stays in R3, this property is generalized for higher dimensions.

The squared Euclidean distance is the sum of squares across all components of the vector. For vector a⃗ with i components, this could be written out as Σai. In linear algebra however, the more conventional expression is xTx for a given vector x.

Taking the square root then gives the actual Euclidean distance, which for a vector a⃗ is notated ||a⃗||.

This can be proven in R3 trivially. For a vector a⃗ with X, Y, and Z components, use the Pythagorean theorem on the X and Y components to calculate a hypotenuse vector. Then use it again with that hypotenuse vector and the Z component.

More generally, the Pythagorean theorem can be shown to hold in Rn space. Suppose that x is [1 2 3] and y is [2 -1 0]. Vector addition demonstrates that z = x + y = [1 2 3] + [2 -1 0] = [3 1 3]. The Pythagorean theorem would then suggest that xTx + yTy = zTz; and it is straightforward to demonstrate that both the left and right hand sides of the equation are 19.

The Pythagorean theorem can be restated as xTx + yTy = (x+y)T(x+y). This formulation leads to the test for orthogonality.


CategoryRicottone

Calculus/Distance (last edited 2025-10-29 14:48:28 by DominicRicottone)