Spatial geometry 3
Last updated
Last updated
The “travel” distance between points in space is measured in the Euclidean sense.
For two points and
their Euclidean distance is expressed as
i.e. the square root of the sum of square differences between coordinates.
The idea of “distance” or a spatial “metric” is not strictly important. In fact most of classical Euclidean geometry completely forbids measuring in the sense of using a ruler. It operates in pure translation and scaling without such bogus concepts as the “square root”. The Pythagorean theorem talks about the “squares” of the sides, not the “lengths” of the sides, of an orthogonal triangle obey the famous equation.
i.e. equals the square root of the sum of squares of the vector’s components.
The length of the vector has semantically the same units as a point’s coordinates or vector’s components. After all we are squaring, which takes us up to a notion of area but then we take the square root eventually back down to a linear length sense.
Normalization
A special type of scaling we perform to vectors is normalization or unitization. The aim is to extract the directional content of the vector discarding the information stored in its magnitude. Numerically the way to achieve this is by dividing the vector by its length thus causing it to become one unit in length.
By dividing a vector’s components, which express lengths in linear units, with its magnitude, which also encompasses linear length, we remove the sense of length from a normalized vector. We may consider a normalized vector as the equivalent of a percentage in 1D. This is the sense in which a unit vector becomes pure direction.
Practice
Create a zero vector and use the “unitize” component. What is the result? Does it make sense? Why this can be geometrically useful thing to do?
There other types of distance functions [] but the Euclidean distance, or L2-norm, is considered the default. We also denote the distance between two points “P” and “Q” with the absolute value bars of
A vector’s length, or magnitude, is computed directly from its x, y and z components using again the Euclidean metric. For a vector
its length is expressed as
We often use the symbol i.e. read u-hat, to denote a normalized vector.
We can write this as
where is a vector i.e. and the symbol represents the length of the vector.
Manhattan-distance [] is a peculiar alternative to Euclidean distance. Try to implement it using basic components.