blob: 6c25366f6281a54f14e1bfc3249ed95f225d3cd1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
|
clc
//Initialization of variables
A=[-1 -1 -1 ]
B=[1 1 -1]
//calculations
Ad=sqrt(1+1+1)
Bd=sqrt(1+1+1)
dot=A.*B /(Ad*Bd)
theta=acosd(dot)
//results
printf("Angle = %.2f degrees",theta(1,1))
|