-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathorientation_xy.m
37 lines (31 loc) · 1.11 KB
/
orientation_xy.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
function [labels_angle] = orientation_xy(x_xp,y_yp,ap_aoa)
if ap_aoa == 0
temp = abs(atan(y_yp./x_xp).*180/pi);
temp_symbol = y_yp; % y
symbol = zeros(size(temp_symbol));
symbol(temp_symbol >= 0) = -1;
symbol(temp_symbol < 0) = 1;
labels_angle = symbol.*temp;
elseif ap_aoa == 90
temp = abs(atan(x_xp./y_yp).*180/pi);
temp_symbol = x_xp; % x
symbol = zeros(size(temp_symbol));
symbol(temp_symbol < 0) = -1;
symbol(temp_symbol >= 0) = 1;
labels_angle = symbol.*temp;
elseif ap_aoa == -90
temp = abs(atan(x_xp./y_yp).*180/pi);
temp_symbol = x_xp; % x
symbol = zeros(size(temp_symbol));
symbol(temp_symbol < 0) = 1;
symbol(temp_symbol >= 0) = -1;
labels_angle = symbol.*temp;
elseif ap_aoa == 180
temp = abs(atan(y_yp./x_xp).*180/pi);
temp_symbol = y_yp; % y
symbol = zeros(size(temp_symbol));
symbol(temp_symbol < 0) = -1;
symbol(temp_symbol >= 0) = 1;
labels_angle = symbol.*temp;
end
end