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.