how can i solve this angle between vectors?

8 views (last 30 days)
nurul aqilah
nurul aqilah on 4 Dec 2015
Answered: VBBV on 15 Mar 2023
Find the angle between the vectors a and b given that a = 3; b = 5; and a-b = 7:

Answers (2)

Andrei Bobrov
Andrei Bobrov on 4 Dec 2015
Edited: Andrei Bobrov on 4 Dec 2015

Law of cosines

a = 3; 
b = 5;
c = 7; % c = a - b
alpha = acos((a.^2 + b.^2 - c.^2)./(2*a*b));

VBBV
VBBV on 15 Mar 2023
a = 3;
b = 5;
c = 7;
alpha = acosd((a.^2 + b.^2 - (c).^2)./(2*a*b))
alpha = 120.0000

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!