-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgetCrysParam.m
More file actions
20 lines (16 loc) · 774 Bytes
/
getCrysParam.m
File metadata and controls
20 lines (16 loc) · 774 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
function getCrysParam = getCrysParam(A)
% Axial vectors
a1 = A(1,:);
a2 = A(2,:);
a3 = A(3,:);
alpha = (180/pi())*acos(getDotproduct(a1,a2)/(sqrt(getDotproduct(a1, ...
a1))*sqrt(getDotproduct(a2,a2))));
beta = (180/pi())*acos(getDotproduct(a2,a3)/(sqrt(getDotproduct(a3, ...
a3))*sqrt(getDotproduct(a2,a2))));
gamma = (180/pi())*acos(getDotproduct(a1,a3)/(sqrt(getDotproduct(a3, ...
a3))*sqrt(getDotproduct(a1,a1))));
maga1 = sqrt(getDotproduct(a1,a1));
maga2 = sqrt(getDotproduct(a2,a2));
maga3 = sqrt(getDotproduct(a3,a3));
getCrysParam = [maga1,maga2,maga3;alpha,beta,gamma];
endfunction