30
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 , ,
The inner product is defined:
Program
?→ A:?→ B:?→ C:A → X:B → Y:C → M:?→ A:?→ B:?→ C:A + X
→ A:B + Y → B:C + M → C:A B C 2X-A→A:2Y-B→B:2M
-C→C:A B C (X - A)X+(Y-B)Y+(M - C)M → D:D < 111 STEP >
INPUT A,B,C(first time) : A,B,C(second time):
OUTPUT A,B,C(first time) : sum of two vectors
A,B,C(second time): difference of two vectors
D : inner product
Execution Example:
For and ,
, ,
α ab
c,,()=
→
β a
′
b
′ c′,,()=
→
β
β
α
α
β
α
αβ
+ abc,,()a′ b′ c′,,()+ aa′+ bb′+ cc′+,,()==
→
→
αβ
– abc,,()a′ b′ c′,,()– aa′– bb′– cc′–,,()==
→
→
αβ
⋅
α
β
θ
cos aa′ bb′ cc′++==
→
→
→
→
α
abc,,()=
→
β
a
′
b
′
c
′
,,()=
→
αβ
⋅
→
α
1 23,,()=
→
β
28 3–,,()=
→
αβ
+ 3 100,,()=
→
→
αβ
– 1– 6– 6,,()=
→
→
αβ
⋅ 9=
→
→
Prog
1
S A
D R
P1
P2 P3 P4
G
関数電卓事例集 .book 30 ページ 2002年9月2日 月曜日 午後6時51分