-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathlocalization.cfg
72 lines (66 loc) · 1.81 KB
/
localization.cfg
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# helper functions for drawing of arrows from localization results
#
# AUTHOR: Hagen Wierstorf
# load mathematical helper functions like deg(), rad()
load 'mathematics.cfg'
# @localization_arrow
# arrow drawn at the point the listener is sitting, pointing toward the
# perceived direction
set palette defined (\
1 '#ffee00',\
2 '#ff7000',\
3 '#ee0000',\
4 '#7f0000')
arrow_size = 7
arrow_x(phi) = (arrow_size+0.1)/50.0*cos(rad(phi)+pi/2)
arrow_y(phi) = (arrow_size+0.1)/50.0*sin(rad(phi)+pi/2)
localization_arrow = 'u ($1-arrow_x($3)):($2-arrow_y($3)):(2*arrow_x($3)):(2*arrow_y($3)):(abs($4)) with vectors head size 0.1,20,60 filled lc palette lw 3 lt 1'
# @localization_grey_line
# line going from the listener position towards the edge of the figure
set style line 202 lc rgb '#d6d7d9' pt 7 ps 2 lt 1 lw 1
grey_line_size = 500
grey_line_x(phi) = (grey_line_size+0.1)/50.0*cos(rad(phi)+pi/2)
grey_line_y(phi) = (grey_line_size+0.1)/50.0*sin(rad(phi)+pi/2)
localization_grey_line = 'u 1:2:(grey_line_x($3)):(grey_line_y($3)) with vectors nohead ls 202'
# @point_source
# plot a point source (large grey point) at the specific point
set_point_source(x,y) = sprintf('<echo "%f %f"',x,y)
point_source = 'w p lc rgb "gray" pt 7 ps 1.7'
# @plane_wave
# plot three lines with an arrow to symbolize a plane wave
set_plane_wave(x,y) = sprintf('<echo "\
%f %f\n\
%f %f\n\
\n\
%f %f\n\
%f %f\n\
\n\
%f %f\n\
%f %f\n\
\n\
%f %f\n\
%f %f\n\
\n\
%f %f\n\
%f %f\n\
\n\
%f %f\n\
%f %f"',\
x-1,y,\
x+1,y,\
x-1,y+0.1,\
x+1,y+0.1,\
x-1,y-0.1,\
x+1,y-0.1,\
x,y-0.1,\
x,y-0.4,\
x,y-0.4,\
x+0.1,y-0.3,\
x,y-0.4,\
x-0.1,y-0.3\
)
plane_wave = 'w l lc rgb "gray" lt 1 lw 2'
# @focused_source
# plot a focused source (large grey open point) at the specific position
set_focused_source(x,y) = sprintf('<echo "%f %f"',x,y)
focused_source = 'w p lc rgb "gray" pt 7 ps 1.7 lw 3'