In addition to enabling the definition of lengths of vectors, as well as the distance between two vectors, inner products also capture the geometry of a vector space by defining the angle $\omega$ between two vectors.
Assume $x \ne 0, y \ne 0$, then
therefore there exist a unique $\omega \in [0,\pi]$ with
$ cos \omega= \frac{<x,y> }{\left \| x \right \|\left \| y\right \|}$
The number $\omega$ is the angle between the vectors $x$ and $y$. Intuitively, the angle between two vectors tells us how similar their orientations are. For example, using the dot product, the angle between $x$ and $y = 4x$, i.e., y is a scaled version of x, is 0: Their orientation is the same.
Example ( university question)
Lets consider the angle between $x=[1,1]^T \in \mathbb{R}^2$ and $y=[1,2]^T \in \mathbb{R}^2$.If we use dot product as the inner product
$cos \omega=\frac{<x,y>}{\sqrt{<x,x><y,y>}}=\frac{x^Ty}{\sqrt{x^Txy^Ty}}=\frac{3}{\sqrt{10}}$
# calculating angle between vectors
from math import sqrt
import numpy as np
# define data
x =np.array([1,1])
y =np.array([1,2])
print("x")
print(x)
print("y")
print(y)
cosw = x.dot(y)/(sqrt(x.dot(x)*y.dot(y)))
print("angle between vectors in radiance")
print(np.arccos(cosw))
print("angle between vectors in degrees")
print(np.arccos(cosw)*180.0/np.pi)
O/P
x [1 1]
y
[1 2]
angle between vectors in radiance
0.3217505543966423
angle between vectors in degrees
18.434948822922017
Orthogonality
Two vectors $x$ and $y$ are orthogonal if and only if $<x,y>=0$, and we write $x \perp y$. If additionally $\left \| x \right \| = 1 = \left \| y \right \|$, i.e., the vectors are unit vectors, then $x$ and $y$ are orthonormal.
An implication of this definition is that the 0-vector is orthogonal to every vector in the vector space.
Note: vectors that are orthogonal with respect to one inner product do not have to be orthogonal with respect to different inner product.
Example:University question
Are the vectors $x = [2, 5 ,1]^š¯‘‡$ and $y = [9, −3 ,6]^š¯‘‡ $ orthogonal?. Justify your answer.Their dot product is $2*9 + 5* -3 + 1*6=18-15+6=9$, which is not equal to zero.
So the vectors are not orthogonal.
The angle between them is $(\theta)=arccos(9/\sqrt{30}.\sqrt{126})$, which is not 90 degrees.
Example:University question
Determine whether the vectors $a=\begin{bmatrix}
3\\
0\\
-2
\end{bmatrix} b=\begin{bmatrix}
2\\
0\\
3
\end{bmatrix}$ are orthogonal or not
The dot product $a.b=6+0-6=0$. Hence the vectors are orthogonal
Comments
Post a Comment