-
Notifications
You must be signed in to change notification settings - Fork 0
/
fourthirdspaper.gpi
107 lines (85 loc) · 2.97 KB
/
fourthirdspaper.gpi
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
unset log
unset label
unset key
unset arrow
set xtics 0,10,200
set ytics 0,0.5,3
set title "\\vspace\{0.5in\}\{\\LARGE 4:3 Earth Propagation Diagram\}"
set xlabel "\\vspace\{-0.5in\}\{\\Large Distance from QTH, in km\}"
set ylabel "\{\\Large Elevation (Kilometers)\}"
set angles degrees
set style line 1 lt 1 lc rgb "#bbbbff" # light blue lines
set style line 2 lt 1 lc rgb "#000000" # black lines
set style line 3 lw 0.5 lt 1 lc rgb "#bbbbff" # thin light blue lines
set style arrow 1 nohead lt 1 lc rgb "#bbbbff" back
set style arrow 2 nohead lt 2 lc rgb "#000000" front
baseradius = 6371.0
radius=8500.0
# Not fundamentally different (about 6 km):
# radius = baseradius * 4 / 3
# besides, 4/3 is an approximation anyway, and does not
# account for thermal inversions, sporadic E, troposcatter, etc.,
# so remember this whole exercise is *useful*, not *precise*.
delta=0.0
circ = 2.0 * pi * radius
downrange = 200.0
arc= (downrange/circ * 360.0)
halfarc = arc / 2
onekm = asin(1/circ)
offset1 = radius * cos(-1 * halfarc) - radius
set xrange[0:downrange]
mult=1.0
set yrange[0:3]
print " "
print "============================================"
print "radius = ", radius
circlabel = gprintf ("circumference = %0.3f km.", circ)
print circlabel
arclabel= gprintf("arc length (degrees) = %0.3f" , arc)
print arclabel
kmlabel= gprintf( "one km of arc (degrees) = %0.5f",onekm)
print kmlabel
offsetlabel=gprintf( "Y offset = %0.4f km.", offset1)
print offsetlabel
print "============================================"
print " "
#######################################################################
# The big y-position function for this arc:
ypos(offset1, x, halfarc, mult, delta1) = \
( ( (radius * cos( asin(x / radius) - halfarc ) ) - radius ) * mult ) \
- offset1 + ( delta1/100.0 )
#######################################################################
midpointoffset=120
yorigin = radius - offset1
set size 2,2
# The -plot- statement, here with loops to make the graphing paper grids.
# first blue lines, then black lines at larger intervals:
plot for [i=0:240:4] (x, ypos(offset1, x, halfarc, mult, i) ) ls 3 , \
\
for [i=0:240:20] (x, ypos(offset1, x, halfarc, mult, i) ) ls 2
# thinner vertical lines:
do for [r=0:200:2] {
ypos1 = ypos(offset1, r, halfarc, mult, 0.0 )
ypos2 = ypos(offset1, r, halfarc, mult, 240.0 )
set arrow from r, ypos1 to r, ypos2 as 1
}
# thicker vertical lines:
do for [r=0:210:10] {
ypos1 = ypos(offset1, r, halfarc, mult, 0.0 )
ypos2 = ypos(offset1, r, halfarc, mult, 240.0 )
set arrow from r, ypos1 to r, ypos2 as 2
}
# LaTeX and EPS output:
set terminal epslatex color fontscale 1.0
set output "inserteps.tex"
refresh
# Postscript output:
set title "4:3 Earth Propagation Diagram"
set xlabel "Distance from QTH, in km"
set ylabel "Elevation (Kilometers)"
set terminal postscript eps enhanced color "Times-Roman" 14 fontscale 2.0
set output "FourThirdsPropagationPaper.ps"
replot
set output
set terminal aqua
# EOF