21
The sum, difference and inner
product of two vectors
The sum and difference of two vectors in 3-dimensional space is obtained by adding and
subtracting their respective components.
α
→
For example, for
→
α β
(
)
→
+
=
a b c
, ,
+
→
α β
(
)
→
–
=
a b c
, ,
–
The inner product is defined:
→
→ →
α β
α β
→
⋅
=
cos
?→ A:?→ B:?→ C:A → X:B → Y:C → M:?→ A:?→ B:?→ C:A + X
→ A:B + Y → B:C + M → C:A
- C → C : A
B
INPUT
A,B,C(first time)
OUTPUT A,B,C(first time)
A,B,C(second time): difference of two vectors
D
α
→
(
)
=
1 2 3
, ,
For
→
α β
→
(
,
+
=
3 10 0
Prog
1
30
→
β
(
)
a b
=
, ,
c
=
,
(
)
(
a' b' c'
,
,
=
a
(
)
(
a' b' c'
,
,
=
a a'
θ
=
aa'
+
bb'
+
cc'
(X - A) X + (Y - B) Y + (M - C) M → D : D < 111 STEP >
C
α
→
:
: sum of two vectors
: inner product
→
β
(
=
2 8 3 –
, ,
and
→
α β
,
)
→
(
–
=
1 – 6 – 6
,
(
'
,
' c'
,
)
a
b
,
)
+
a'
,
b
+
b'
,
c
+
c'
)
–
,
b b'
–
,
c c'
–
B
C
2 X - A → A:2 Y - B → B:2 M
(
)
=
a b c
, ,
A,B,C(second time):
→
α β
→
⋅
)
,
→
α β
,
,
)
→
⋅
=
,
S A
→
β
=
9
P1 P1 P2 P3 P4
D R
'
'
'
(
)
a
,
b
,
c
G