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 ω between two vectors.
Assume x≠0,y≠0, then
therefore there exist a unique ω∈[0,π] with
cosω=<x,y>‖x‖‖y‖
The number ω 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∈R2 and y=[1,2]T∈R2.If we use dot product as the inner product
cosω=<x,y>√<x,x><y,y>=xTy√xTxyTy=3√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⊥y. If additionally ‖x‖=1=‖y‖, 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 (θ)=arccos(9/√30.√126), which is not 90 degrees.
Example:University question
Determine whether the vectors a=[30−2]b=[203] are orthogonal or not
The dot product a.b=6+0−6=0. Hence the vectors are orthogonal
Comments
Post a Comment