This module is part of the collection, A First Course in Electrical and Computer Engineering. The LaTeX source files for this collection were created using an optical character recognition technology, and because of this process there may be more errors than usual. Please contact us if you discover any errors.
Unit Vectors. Corresponding to every vector
x
x is a unit vector
u
x
u
x
pointing in the same direction as
x
x. The term unit vector means that the
norm of the vector is 1:
|
|
u
x
|
|
=
1
.
|
|
u
x
|
|
=
1
.
(1)
The question is, given
x
x, how can we find
u
x
u
x
? The first part of the answer is
that
u
x
u
x
will have to be a positive scalar multiple of
x
x in order to point in the
same direction as x
x, as shown in Figure 1. Thus
u
x
=
α
x
.
u
x
=
α
x
.
(2)
But what is
α
α? We need to choose
α
α so that the norm of
u
x
u
x
will be 1:
|
|
u
x
|
|
=
1
|
|
u
x
|
|
=
1
(3)
|
α
x
|
|
=
1
|
α
x
|
|
=
1
(4)
|
α
|
|
|
x
|
|
=
1
|
α
|
|
|
x
|
|
=
1
(5)
α
=
1
|
|
x
|
|
α
=
1
|
|
x
|
|
(6)
We have dropped the absolute value bars on
α
α because ||x||||x|| is positive. The
α
α that does the job is 1 over the norm of
x
x. Now we can write formulas for
u
x
u
x
in terms of
x
x and
xx in terms of
u
x
u
x
:
u
x
=
1
|
|
x
|
|
x
,
u
x
=
1
|
|
x
|
|
x
,
(7)
x
=
|
|
x
|
|
u
x
.
x
=
|
|
x
|
|
u
x
.
(8)
So the vector
x
x is its direction vector
u
x
u
x
, scaled by its Euclidean norm.
Unit Coordinate Vectors. There is a special set of unit vectors called the unit coordinate vectors. The unit coordinate vector
e
i
e
i
is a unit vector in
∇
n
∇
n
that points in the positive direction of the ithith coordinate axis. Figure 2 shows the three unit coordinate vectors in
∇
3
∇
3
.
For three-dimensional space,
R
3
R
3
, the unit coordinate vectors are
e
1
=
1
0
0
,
e
2
=
0
1
0
,
e
3
=
0
0
1
.
e
1
=
1
0
0
,
e
2
=
0
1
0
,
e
3
=
0
0
1
.
(9)
More generally, in n-dimensional space, there are
n
n unit coordinate vectors
given by
You should satisfy yourself that this definition results in vectors with a norm
of l.
Find the norm of the vector au where
u
u is a unit vector.
Find the unit vector
u
x
u
x
in the direction of
- x=34x=34 ;
- x=36-2x=36-2 ;
- x=1-11-1.x=1-11-1.
Direction Cosines. We often say that vectors “have magnitude and direction.” This is more or less obvious from "Linear Algebra: Vectors", where the three-dimensional vector
x
x has length x12+x22+x32x12+x22+x32 and points in a direction defined by the components x1,x2x1,x2, and
x
3
x
3
. It is perfectly obvious from Equation 8 where
x
x is written as x=||x||uxx=||x||ux. But perhaps there is another representation for a vector that places the notion of magnitude and direction in even clearer evidence.
Figure 4 shows an arbitrary vector x∈R3x∈R3 and the three-dimensional
unit coordinate vectorse1,e2,e3e1,e2,e3. The inner product between the vector
x
x and
the unit vector
e
k
e
k
just reads out the kthkth component of
x
x:
(x,ek)=(ek,x)=xk.(x,ek)=(ek,x)=xk.(10)
Since this is true even in
R
n
R
n
, any vector x∈Rnx∈Rn has the following representation in terms of unit vectors:
x
=
(
x
,
e
1
)
e
1
+
(
x
,
e
2
)
e
2
+
⋯
+
(
x
,
e
n
)
e
n
.
x
=
(
x
,
e
1
)
e
1
+
(
x
,
e
2
)
e
2
+
⋯
+
(
x
,
e
n
)
e
n
.
(11)
Let us now generalize our notion of an angle
θ
θ between two vectors to
R
n
R
n
as follows:
cosθ=(x,y)||x||||y||cosθ=(x,y)||x||||y||
(12)
The celebrated Cauchy-Schwarz inequality establishes that -1-≤-1-≤ cos θ≤1θ≤1.
With this definition of angle, we may define the angle
θ
k
θ
k
that a vector makes
with the unit vector
e
k
e
k
to be
cosθk=(x,ek)||x||||ek||cosθk=(x,ek)||x||||ek||
(13)
But the norm of
e
k
e
k
is 1, so
cos
θ
k
=
(
x
,
e
k
)
|
|
x
|
|
=
x
k
|
|
x
|
|
cos
θ
k
=
(
x
,
e
k
)
|
|
x
|
|
=
x
k
|
|
x
|
|
(14)
When this result is substituted into the representation of x in Equation 11,
we obtain the formula
x
=
|
|
x
|
|
c
o
s
θ
1
e
1
+
|
|
x
|
|
c
o
s
θ
2
e
2
+
⋯
+
|
|
x
|
|
c
o
s
θ
n
e
n
=
|
|
x
|
|
(
cos
θ
1
e
1
+
cos
θ
2
e
2
+
⋯
+
cos
θ
n
e
n
)
.
x
=
|
|
x
|
|
c
o
s
θ
1
e
1
+
|
|
x
|
|
c
o
s
θ
2
e
2
+
⋯
+
|
|
x
|
|
c
o
s
θ
n
e
n
=
|
|
x
|
|
(
cos
θ
1
e
1
+
cos
θ
2
e
2
+
⋯
+
cos
θ
n
e
n
)
.
(15)
This formula really shows that the vector
x
x has “magnitude” ||x||||x|| and direction (θ1,θ2,...,θn)(θ1,θ2,...,θn) and that the magnitude and direction are sufficient to determine
x
x. We call ( cosθ1cosθ1, cos θ2,...θ2,..., cos
θ
n
θ
n
) the direction cosines for the vector
x
x. In the three-dimensional case, they are illustrated in Figure 4.
Show that Equation 12 agrees with the usual definition of an
angle in two dimensions.
Find the cosine of the angle between
x
x and
y
y where
- x=100,y=222x=100,y=222 ;
- x=1-11-1,y=-1010x=1-11-1,y=-1010 ;
- x=21-2,y=42-4x=21-2,y=42-4
If we compare Equation 8 and Equation 15 we see that the direction vector
u
x
u
x
is composed of direction cosines:
u
x
=
cos
θ
1
e
1
+
cos
θ
2
e
2
+
⋯
+
cos
θ
n
e
n
=
c
o
s
θ
1
c
o
s
θ
2
⋮
c
o
s
θ
n
.
u
x
=
cos
θ
1
e
1
+
cos
θ
2
e
2
+
⋯
+
cos
θ
n
e
n
=
c
o
s
θ
1
c
o
s
θ
2
⋮
c
o
s
θ
n
.
(16)
With this definition we can write Equation 15 compactly as
Here
x
x is written as the product of its magnitude ||x||||x|| and its direction vector
u
x
u
x
. Now we can give an easy procedure to find a vector's direction angles:
(i) find ||x||||x||;
(ii) calculate ux=x||x||ux=x||x||; and
(iii) take the arc cosines of the elements of
u
x
u
x
.
Step (iii) is often unnecessary; we are usually more interested in the direction
vector (unit vector) ux. Direction vectors are used in materials science in
order to study the orientation of crystal lattices and in electromagnetic field
theory to characterize the direction of propagation for radar and microwaves.
You will find them of inestimable value in your courses on electromagnetic
fields and antenna design.
Sketch an arbitrary unit vector u∈R3u∈R3. Label the direction
cosines and the components of u.Su.S
Compute the norm and the direction cosines for the vector
x=426.x=426.
Prove that the direction cosines for any vector satisfy the
equality
cos
2
θ
1
+
cos
2
θ
2
+
⋯
+
cos
2
θ
n
=
1
.
cos
2
θ
1
+
cos
2
θ
2
+
⋯
+
cos
2
θ
n
=
1
.
(17)
What does this imply about the number of scalars needed to determine a vector
x∈Rnx∈Rn ?
Astronomers use right ascension, declination, and distance to
locate stars. On Figure 4 these are, respectively, -φ,π2-θ3-φ,π2-θ3, and ||x||||x||.
Represent x=(x1,x2,x3)x=(x1,x2,x3) in terms of φ,θ3φ,θ3, and ||x||||x|| only. (That is, find
equations that give φ,θ3φ,θ3, and ||x||||x|| in terms of x1,x2x1,x2, and x3, and find
equations that give x1,x2x1,x2, and x3 in terms of φ,θ3φ,θ3, and ||x||.)||x||.)
(MATLAB) Write a MATLAB function that accepts any vector
x∈Rnx∈Rn and computes its norm and direction cosines. Make x an input
variable, and make ||x||||x|| and
u
x
u
x
output variables.
Let
x
x and
y
y denote two vectors in
R
n
R
n
with respective direction
cosines (
cos
θ
1
,
cos
θ
2
,
...
,
cos
θ
n
cos
θ
1
,cos
θ
2
,
...
,cos
θ
n
) and (
cos
φ
1
,
cos
φ
2
,
...
,
cos
φ
n
cos
φ
1
,cos
φ
2
,
...
,cos
φ
n
). Prove that
ψ
ψ, the angle between
x
x and
y
y, is
cos
ψ
=
cos
θ
1
cos
φ
1
+
cos
θ
2
cos
φ
2
+
⋯
+
cos
θ
n
cos
φ
n
.
cos
ψ
=
cos
θ
1
cos
φ
1
+
cos
θ
2
cos
φ
2
+
⋯
+
cos
θ
n
cos
φ
n
.
(18)
Specialize this result to
R
2
R
2
for insight.
Compute the angle between the vectors x=230x=230 and 231231.
Sketch the result.
"A First Course in Electrical and Computer Engineering provides readers with a comprehensive, introductory look at the world of electrical engineering. It was originally written by Louis Scharf […]"