42. Vectors - JulTob/Mathematics GitHub Wiki
Vectors: โโฟ Dimensions
Vectors and Motion
Position Point
A point exists even if nothing stands on it. It does not move, as it is space itself. It is a type of abstraction that allows us to separate and differentiate spaces. We can do that by structuring its Dimensions. These are components that, ordered together, establish properties of these Points. It can be real Spaces with real Dimensions, but it may also be Data Points of abstract objects (such as 'โจheight,weightโฉ' represents a person's length-weight space).
Point: A location in a space.
A point $๐ฟ$ may be described by its basic components, its specific datum of the space. These components exist in spaces that do not mix together (they are perpendicular to each other), but exist in an ordered Cartesian Product macro-space that they build by being together.
\color{#00b4d8}
\text{๐ฟosition} = ๐_x โ ๐ โ ๐_y โ ๐ โ ๐_z โ โค
\color{#00b4d8}
= ๏ผ๐_x๏ผ๐_y๏ผ๐_z๏ผโ (๐ โจฏ ๐ โจฏ โค)
\begin{matrix}
โข & โ & โข & โข & โข & โข & โข\\
โข & โ & โข & โข & โข & โข & โข\\
๐_๐ฆ & {\color{#00b4d8}โฆฟ} & โข & โข & {\color{#00b4d8}๐โ} & โข & โข\\
โข & โ & โข & โข & โข & โข & โข\\
โข & โ & โข & โข & โข & โข & โข\\
โข & โ & โข & โข & โข & โข & โข\\
โ & โฑ & โ & โ & {\color{#00b4d8}โฆฟ} & โ & โ \\
โข & โ & โข & โข & ๐_๐ฅ & โข & โข\\
\end{matrix}
Points do not mix together, they just exist there. But there are also other types of entities that belong to those spaces. When we transport something from point to point, compare them, or interact within the framework of these points we are using Vectors.
Vector: defined by a magnitude and a direction.
For example, when we "locate" a point first we establish a "null state", an "origin" from where all other points are synthesized against. We can locate points by the use of the Position Vector of that data point by adding the component's values from the "null".
\color{#00b4d8}
\vec{\text{position}} = ๐_x ยท ๐ฅฬ + ๐_y ยท ๐ฆฬ + ๐_z ยท ๐งฬ
\color{#00b4d8}
= โจ๐_x๏ผ๐_y๏ผ๐_zโฉ
This represents the position vector in three-dimensional space, expressed in terms of its components along the $x$, $y$, and $z$ axes.
\begin{matrix}
โข & โ & โข & โข & โข & โข & โข\\
โข & โ & โข & โข & โข & โข & โข\\
โข & {\color{#00b4d8}โฒ๐_๐ฆ} & โข & โข & {\color{#00b4d8}\vec{๐}โฅ} & โข & โข\\
โข & โ & โข & โข & โข & โข & โข\\
โข & โ & โข & โข & โข & โข & โข\\
โข & โ & โข & โข & โข & โข & โข\\
โ & โฑ & โ & โ & {\color{#00b4d8}๐_๐ฅโบ} & โ & โ \\
โข & โ & โข & โข & โข & โข & โข\\
\end{matrix}
If we apply a vector to a point, by adding, we obtain a different point in the data space.
\color{Cerulean}
๐_i +\vec{u} = ๐_f
\color{Cerulean}
[โ] + [\vec{๐}] = [โ]
Therefore we can establish the transformation of the vector as the difference between these point elements.
\color{Cerulean}
\vec{u} = ๐_f - ๐_i
\color{Cerulean}
[\vec{๐}] = [โ] - [โ]
Notice that the "position" of origin of the vector doesn't define it. The same vector may exist in any and all positions of the data space. A vector is, therefor, an application on the data, not a data point. Actions, not objects. They are verbs in the language of math.
Vectors are morphisms.
Magnitude of a Vector $\vec{u}$
A vector represents a change. Its magnitude is the energy of that change: how far, how much, how strongly it acts. Its magnitude, or length, is the measure of movement it produces and the extent of transformation it represents, without a specific direction.
With this formula we calculate the length of a vector in three-dimensional space, using the old Pythagorean theorem.
\color{Cerulean}
|๐ฎโ| = \sqrt{u_x^2 + u_y^2 + u_z^2} = \sqrt{๐ฎโยท๐ฎโ} = ๐
A point is a place.
A vector is an arrow.
But the magnitude? That is the tension in the bow.
Unit Vector in the Direction of $\vec{u}$
A unit vector is a minimal vector distilled to its pure direction. It moves in a certain direction, but only as far as one step.
To create it, we reduce to a unit its magnitude:
\color{BlueGreen}
\hat{u} = \frac{๐ฎโ}{|๐ฎโ|}
A unit vector has a magnitude of 1 and indicates the direction of $๐ฎโ$. It is obtained by dividing the vector by its magnitude.
Therefore we can also express a vector as:
\color{Cerulean}
๐ฎโ ๏ผ ๐uฬ = uฬ๐
That is, a magnitude $U$ in the direction $uฬ$.
Vector Algebra
These are the fundamental rules of vector addition, subtraction, and scalar multiplication, highlighting properties like commutativity and distributivity.
\color{Emerald}
\begin{matrix}
๐ฎโ + ๐ฏโ = ๐ฏโ + ๐ฎโ && (commutative) \\
๐ฎโ + (๐ฏโ + ๐ฐโ) = (๐ฎโ + ๐ฏโ) + ๐ฐโ && (associative)\\
๐ฎโ + 0โ = ๐ฎโ && (identity)\\
๐ฎโ - ๐ฎโ = 0โ && (inverse)\\
c(๐ฎโ + ๐ฏโ) = c๐ฎโ + c๐ฏโ && (scalar distributive over +)\\
(c + d)๐ฎโ = c๐ฎโ + d๐ฎโ && (distributive over scalars)\\
(cd)๐ฎโ = c(d๐ฎโ) = d(c๐ฎโ) && (scalar associativity)\\
1๐ฎโ = ๐ฎโ && (unit scalar)\\
0๐ฎโ = 0โ && (zero scalar)\\
c0โ = 0โ && (zero vector)
\end{matrix}
Commutative:
graph LR
Start@{ shape: start, stroke: black }
PV@{ shape: start, stroke: blue }
PU@{ shape: start, stroke: cyan }
PUV@{ shape: start, stroke: purple }
Start VectorU1@--->|๐ขโ| PU
PU VectorV1@-->|๐ฃโ| PUV
Start VectorUV@--->|"๐ขโ+๐ฃโ"| PUV
Start VectorV2@-->|๐ฃโ| PV
PV VectorU2@--->|๐ขโ| PUV
classDef U stroke: Lime, stroke-width: 3;
classDef V stroke: Red, stroke-width: 3;
classDef UV stroke: Gold, stroke-width: 3;
class VectorU1 U;
class VectorU2 U;
class VectorV1 V;
class VectorV2 V;
class VectorUV UV;
Associative
graph LR
Start@{ shape: start, stroke: black }
PU@{ shape: start, stroke: cyan }
PUV@{ shape: start, stroke: blue }
PUVW@{ shape: start, stroke: cyan }
PUV@{ shape: start, stroke: purple }
Start VectorU@--->|๐ขโ| PU
PU VectorV@-->|๐ฃโ| PUV
PU VectorVW@-->|"๐ฃโ+๐คโ"| PUVW
PUV VectorW@-->|๐คโ| PUVW
Start VectorUV@--->|"๐ขโ+๐ฃโ"| PUV
Start VectorUVW@--->|"๐ขโ+๐ฃโ+๐คโ"| PUVW
classDef V stroke: Red, stroke-width: 3;
classDef C stroke: Tomato, stroke-width: 3 , stroke-dasharray: 4 8;
classDef D stroke: Crimson, stroke-width: 3 , stroke-dasharray: 8 10;
class VectorU V;
class VectorUV C;
class VectorUVW D;
class VectorV V;
class VectorW V;
class VectorVW C;
Vector Difference
\color{Lime}
\vec{P_1P_2} = โจx_2 - x_1๏ผy_2 - y_1๏ผz_2 - z_1โฉ
This formula defines a vector as the difference between two points in space.
Distance between $๐ฏ$ and $๐ฐ$
\color{Lime}
\text{distance}(๐ฏ_1, P_2) = |\vec{P_1P_2}| = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2 + (z_2 - z_1)^2}
This gives the Euclidean distance between two points $๐ฏ_1$ and $P_2$ in three-dimensional space.
In โยฒ
If a vector $๐ฎโ$ is represented in the plane by an Origin Point $\color{Red}๐ฏ(x_1, y_1)$ and an endpoint $\color{Red}๐ฐ(x_2๏ผy_2)$, then:
\color{Gold}
๐ฎโ = โจx_2-x_1๏ผy_2-y_1โฉ
The components of $๐ฎโ$ are found by subtracting the coordinates of the origin from those of the endpoint.
Magnitude in โยฒ
\color{DarkOrange}
|๐ฎโ| = \sqrt{a^2 + b^2}
The Magnitude or length of a vector $\color{DarkOrange} ๐ฎโ = โจa๏ผbโฉ$.
Vector Algebra
\color{Gold}
\begin{matrix}
๐ฎโ + ๐ฏโ = โจa_u + a_v, b_u + b_vโฉ \\
๏ฟข๐ฎโ = โจ ๏ฟขa_u, ๏ฟขb_uโฉ \\
๐ฎโ - ๐ฏโ = โจa_u - a_v, b_u - b_vโฉ \\
c๐ฎโ = โจcยทa_u, cยทb_uโฉ
\end{matrix}
These formulas describe addition, negation, subtraction, and scalar multiplication of vectors in two dimensions.
Unitary Vectors in โยฒ
\color{Gold}
\begin{matrix}
๐ขฬ = โจ1๏ผ0โฉ \quad ๐ฃฬ = โจ0๏ผ1โฉ \\
๐ฎโ = a_u๐ขฬ + b_u๐ฃฬ \\
๐ฎโ = |๐ฎโ| \cos๐ ยท๐ขฬ + |๐ฎโ| \sin๐ ยท๐ฃฬ
\end{matrix}
The unit vectors $๐ขฬ$ and $๐ฃฬ$ define the standard basis for โยฒ, and any vector can be expressed in terms of these basis vectors. They form the 'alphabet' to construct vector 'words'.
Dot Product in โยฒ
\color{Gold}
\begin{matrix}
๐ฎโ ยท ๐ฏโ = a_u ยท a_v + b_u ยท b_v \\
๐ฎโ ยท ๐ฏโ = |๐ฎโ||๐ฏโ|\cos๐ \\
\end{matrix}
This gives:
\color{Gold}
\begin{matrix}
\cos๐ = \frac{๐ฎโ ยท ๐ฏโ}{|๐ฎโ||๐ฏโ|} \\
๐ฎโ ยท ๐ฎโ = |๐ฎโ|^2
\end{matrix}
The dot product measures how much one vector extends in the direction of another and is used to find angles between vectors. It gives a measure of similarity or opposition.
Two vectors are perpendicular (they do not mix or oppose at all) if:
\color{Gold}
๐ฎโ \perp ๐ฏโ \iff ๐ฎโ ยท ๐ฏโ = 0
Two vectors are perpendicular if their dot product is zero.
Component of $๐ฎโ$ along $๐ฏฬ$
\color{Gold}
๐ฎโ_{๐ฏโ} = \frac{๐ฎโ ยท ๐ฏฬ}{|๐ฏโ|} \cdot ๐ฏฬ
This gives the projection (a shadow casted perpendicular) of one vector onto the direction of another.
Pro
\color{gold}
\begin{matrix}
๐ด_ส = ๐ด cos๐ = ๐ดโยทBฬ \\ &&
๐ดโ_ส=๐ด_ส Bฬ = (๐ดโยทBฬ)Bฬ \\
๐ = ๐ดโก๐ต
\end{matrix}
Cross Product in โยณ
\color{Yellow}
\begin{matrix}
๐ฎโ ร ๐ฏโ = \text{det}
\begin{bmatrix}
\hat{x} & \hat{y} & \hat{z} \\
u_x & u_y & u_z \\
v_x & v_y & v_z
\end{bmatrix} \\
= โจu_y v_z - u_z v_y๏ผu_z v_x - u_x v_z๏ผu_x v_y - u_y v_xโฉ
\end{matrix}
The cross product produces a vector orthogonal to both input vectors and is proportional to the area of the parallelogram spanned by them.
Triple Product
This scalar is the volume of a parallelepiped with the input Position Vectors as edges.
\color{Ruby}
๐ฎโ ยท (๐ฏโ ร ๐ฐโ) = \text{Volume of parallelepiped formed by } ๐ฎโ, ๐ฏโ, ๐ฐโ
\color{Ruby}
๐ฎโ ยท (๐ฏโ ร ๐ฐโ) = \text{det}
\begin{bmatrix}
u_x & u_y & u_z \\
v_x & v_y & v_z \\
w_x & w_y & w_z
\end{bmatrix}
This expresses the component of $๐ฎโ$ along $๐ฏโ$, giving its projection as a vector.
Triangle Inequality
For any two vectors $๐ฎโ$ and $๐ฏโ$,
โฎ๐ฎโ + ๐ฏโโฎ โค โฎ๐ฎโโฎ + โฎ๐ฏโโฎ
Equality holds if and only if either $(๐ฏโ)$ is a scalar multiple of $(๐ฎโ)$, or one of them is 0.
The shortest path is never longer than the joined paths.
Cauchy-Schwarz Inequality
For any two vectors $๐ฎโ$ and $๐ฏโ$,
โฎ๐ฎโ ยท ๐ฏโโฎ โค โฎ๐ฎโโฎ ยท โฎ๐ฏโโฎ
This can be seen in 2D simply as:
โฎโจ๐,๐โฉ ยท โจ๐,๐โฉโฎ โค โฎโจ๐,๐โฉโฎ ยท โฎโจ๐,๐โฉโฎ
|๐ยท๐+๐ยท๐| = โ((๐ยท๐)ยฒ+(๐ยท๐)ยฒ) โค โ(๐ยฒ+๐ยฒ)ยทโ(๐ยฒ+๐ยฒ) = โ(๐ยฒ๐ยฒ+๐ยฒ๐ยฒ+๐ยฒ๐ยฒ+๐ยฒ๐ยฒ)
๐ยฒยท๐ยฒ+๐ยฒยท๐ยฒ โค ๐ยฒ๐ยฒ+๐ยฒ๐ยฒ+๐ยฒ๐ยฒ+๐ยฒ๐ยฒ
0 โค ๐ยฒ๐ยฒ+๐ยฒ๐ยฒ
In general:
Equality holds if and only if either $(๐ฏโ)$ is a scalar multiple of $(๐ฎโ)$, or one of them is 0.
The dot product is never greater than the product of magnitudes. Only equal when direction aligns.