-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflightplan
More file actions
548 lines (443 loc) · 13.1 KB
/
flightplan
File metadata and controls
548 lines (443 loc) · 13.1 KB
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
#import flightplanFunctions
def from = "EKRK"
def to = "EKSN"
def reg = "OY-CDT"
def pilot = "test test"
def tas = 95 # TAS in knots
def lph = 12 # FUEL in Liters/hour
def alternate = 5 # fuel to alternate
def reserve = 10 # reserve fuel, liters
def glide = 12 # glide ratio 1:x
def deviation = 1
#CHART SCALE FOR MINUTE MARKS
def scale = 500000
def speedMin = 80 #min GS (for minute lines)
def speedMax = 90 #max GS (for minute lines)
#destinagion runway heading (shown on wind rose)
def landingRwyHdg = 250
#WP1
def title1 = "EKRK"
def dist1 = 10
def tt1 = 90
def windDir1 = 135
def windVel1 = 10
#WP2
def title2 = "EKSN"
def dist2 = 12
def tt2 = 30
def windDir2 = 100
def windVel2 = 10
#WP3
def title3 = "KJELLERUP"
def dist3 = 18
def tt3 = 40
def windDir3 = 100
def windVel3 = 15
#WP4
def title4 = "EKRD"
def dist4 = 20
def tt4 = 45
def windDir4 = 90
def windVel4 = 15
#WP5
def title5 = " - - - "
def dist5 = 0
def tt5 = 0
def windDir5 = 0
def windVel5 = 0
#WP6
def title6 = " - - - "
def dist6 = 0
def tt6 = 0
def windDir6 = 0
def windVel6 = 0
#WP7
def title7 = " - - - "
def dist7 = 0
def tt7 = 0
def windDir7 = 0
def windVel7 = 0
## END USER INPUT ##
## do not edit below this point
############ WAYPOINT CALCULATIONS ##############
#### WPT1 ####
def n1 = sin(radians(tt1 - windDir1))
def wca1a = (windVel1 * n1)
def wca1 = degrees(wca1a / tas * -1)
def th1 = floor(tt1 + wca1)
def c1a = cos(radians(wca1))
def c1b = cos(radians(tt1 - windDir1))
def gs1a = tas * c1a
def gs1b = windVel1 * c1b
def gs1 = gs1a - gs1b
def timeHr1 = dist1 / gs1
def time1 = timeHr1 * 60
def y = 60 # vertical offset
if (dist1 > 0) {
text(-33 y + 26 8 title1) # TITLE
text(-33 y + 15.5 6 tt1)
text(2 y + 15.5 6 dist1)
text(9 y + 31 4 windVel1)
text(3 y + 31 4 windDir1)
text(-33 y + 6.5 6 floor(wca1)) #WCA
text(-15 y + 15.5 6 th1) #TH
text(-15 y + 6.5 9 th1 + deviation) #MH
text(18 y + 26.5 6 floor(gs1)) #GS
text(18 y + 15.5 9 floor(time1)) #TIME, MIN
}
#### WPT2 ####
def n2 = sin(radians(tt2 - windDir2))
def wca2a = (windVel2 * n2)
def wca2 = degrees(wca2a / tas * -1)
def th2 = floor(tt2 + wca2)
def c2a = cos(radians(wca2))
def c2b = cos(radians(tt2 - windDir2))
def gs2a = tas * c2a
def gs2b = windVel2 * c2b
def gs2 = gs2a - gs2b
def timeHr2 = dist2 / gs2
def time2 = timeHr2 * 60
def y = 31 # vertical offset
if (dist2 > 0) {
text(-33 y + 26 8 title2) # TITLE
text(-33 y + 15.5 6 tt2)
text(2 y + 15.5 6 dist2)
text(2 y + 6.5 6 dist1 + dist2) #DIST ACC
text(9 y + 31 4 windVel2)
text(3 y + 31 4 windDir2)
text(-33 y + 6.5 6 floor(wca2)) #WCA
text(-15 y + 15.5 6 th2) #TH
text(-15 y + 6.5 9 th2 + deviation) #MH
text(18 y + 26.5 6 floor(gs2)) #GS
text(18 y + 15.5 9 floor(time2)) #TIME, MIN
text(18 y + 6.5 6 floor(time1 + time2)) #TIME, MIN
}
#### WPT3 ####
def n3 = sin(radians(tt3 - windDir3))
def wca3a = (windVel3 * n3)
def wca3 = degrees(wca3a / tas * -1)
def th3 = floor(tt3 + wca3)
def c3a = cos(radians(wca3))
def c3b = cos(radians(tt3 - windDir3))
def gs3a = tas * c3a
def gs3b = windVel3 * c3b
def gs3 = gs3a - gs3b
def timeHr3 = dist3 / gs3
def time3 = timeHr3 * 60
def y = 2
if (dist3 > 0) {
text(-33 y + 26 8 title3)
text(-33 y + 15.5 6 tt3)
text(2 y + 15.5 6 dist3)
text(2 y + 6.5 6 dist1 + dist2 + dist3) #DIST ACC
text(9 y + 31 4 windVel3)
text(3 y + 31 4 windDir3)
text(-33 y + 6.5 6 floor(wca3)) #WCA
text(-15 y + 15.5 6 th3) #TH
text(-15 y + 6.5 9 th3 + deviation) #MH
text(18 y + 26.5 6 floor(gs3))
text(18 y + 15.5 9 floor(time3))
text(18 y + 6.5 6 floor(time1 + time2 + time3))
}
#### WPT4 ####
def n4 = sin(radians(tt4 - windDir4))
def wca4a = (windVel4 * n4)
def wca4 = degrees(wca4a / tas * -1)
def th4 = floor(tt4 + wca4)
def c4a = cos(radians(wca4))
def c4b = cos(radians(tt4 - windDir4))
def gs4a = tas * c4a
def gs4b = windVel4 * c4b
def gs4 = gs4a - gs4b
def timeHr4 = dist4 / gs4
def time4 = timeHr4 * 60
def y = -27 # vertical offset
if (dist4 > 0) {
text(-33 y + 26 8 title4) # TITLE
text(-33 y + 15.5 6 tt4)
text(2 y + 15.5 6 dist4)
text(2 y + 6.5 6 dist1 + dist2 + dist3 + dist4) #DIST ACC
text(9 y + 31 4 windVel4)
text(3 y + 31 4 windDir4)
text(-33 y + 6.5 6 floor(wca4)) #WCA
text(-15 y + 15.5 6 th4) #TH
text(-15 y + 6.5 9 th4 + deviation) #MH
text(18 y + 26.5 6 floor(gs4)) #GS
text(18 y + 15.5 9 floor(time4)) #TIME, MIN
text(18 y + 6.5 6 floor(time1 + time2 + time3 + time4)) #TIME, MIN
}
#### WPT5 ####
def n5 = sin(radians(tt5 - windDir5))
def wca5a = (windVel5 * n5)
def wca5 = degrees(wca5a / tas * -1)
def th5 = floor(tt5 + wca5)
def c5a = cos(radians(wca5))
def c5b = cos(radians(tt5 - windDir5))
def gs5a = tas * c5a
def gs5b = windVel5 * c5b
def gs5 = gs5a - gs5b
def timeHr5 = dist5 / gs5
def time5 = timeHr5 * 60
def y = -56 # vertical offset
if (dist5 > 0) {
text(-33 y + 26 8 title5) # TITLE
text(-33 y + 15.5 6 tt5)
text(2 y + 15.5 6 dist5)
text(2 y + 6.5 6 dist1 + dist2 + dist3 + dist4 + dist5) #DIST ACC
text(9 y + 31 4 windVel5)
text(3 y + 31 4 windDir5)
text(-33 y + 6.5 6 floor(wca5)) #WCA
text(-15 y + 15.5 6 th5) #TH
text(-15 y + 6.5 9 th5 + deviation) #MH
text(18 y + 26.5 6 floor(gs5)) #GS
text(18 y + 15.5 9 floor(time5)) #TIME, MIN
text(18 y + 6.5 6 floor(time1 + time2 + time3 + time4 + time5)) #TIME, MIN
}
#### WPT6 ####
def n6 = sin(radians(tt6 - windDir6))
def wca6a = (windVel6 * n6)
def wca6 = degrees(wca6a / tas * -1)
def th6 = floor(tt6 + wca6)
def c6a = cos(radians(wca6))
def c6b = cos(radians(tt6 - windDir6))
def gs6a = tas * c6a
def gs6b = windVel6 * c6b
def gs6 = gs6a - gs6b
def timeHr6 = dist6 / gs6
def time6 = timeHr6 * 60
def y = -85 # vertical offset
if (dist6 > 0) {
text(-33 y + 26 8 title6) # TITLE
text(-33 y + 15.5 6 tt6)
text(2 y + 15.5 6 dist6)
text(2 y + 6.5 6 dist1 + dist2 + dist3 + dist4 + dist5 + dist6) #DIST ACC
text(9 y + 31 4 windVel6)
text(3 y + 31 4 windDir6)
text(-33 y + 6.5 6 floor(wca6)) #WCA
text(-15 y + 15.5 6 th6) #TH
text(-15 y + 6.5 9 th6 + deviation) #MH
text(18 y + 26.5 6 floor(gs6)) #GS
text(18 y + 15.5 9 floor(time6)) #TIME, MIN
text(18 y + 6.5 6 floor(time1 + time2 + time3 + time4 + time5 + time6)) #TIME, MIN
}
#### WPT7 ####
def n7 = sin(radians(tt7 - windDir7))
def wca7a = (windVel7 * n7)
def wca7 = degrees(wca7a / tas * -1)
def th7 = floor(tt7 + wca7)
def c7a = cos(radians(wca7))
def c7b = cos(radians(tt7 - windDir7))
def gs7a = tas * c7a
def gs7b = windVel7 * c7b
def gs7 = gs7a - gs7b
def timeHr7 = dist7 / gs7
def time7 = timeHr7 * 60
def y = -114 # vertical offset
if (dist7 > 0) {
text(-33 y + 26 8 title7) # TITLE
text(-33 y + 15.5 6 tt7)
text(2 y + 15.5 6 dist7)
text(2 y + 6.5 6 dist1 + dist2 + dist3 + dist4 + dist5 + dist6 + dist7) #DIST ACC
text(9 y + 31 4 windVel7)
text(3 y + 31 4 windDir7)
text(-33 y + 6.5 6 floor(wca7)) #WCA
text(-15 y + 15.5 6 th7) #TH
text(-15 y + 6.5 9 th7 + deviation) #MH
text(18 y + 26.5 6 floor(gs7)) #GS
text(18 y + 15.5 9 floor(time7)) #TIME, MIN
text(18 y + 6.5 6 floor(time1 + time2 + time3 + time4 + time5 + time6 + time7)) #TIME, MIN
}
#### FUEL CALCULATION ####
def timeTotal = time1 + time2 + time3 + time4 + time5
def hrs = timeTotal / 60
def trip = hrs * lph * 1.055
line(-4 -110 -4 -140)
text(-40 -114 4 "fuel consumption / LITERS")
text(-38 -120 6 "trip fuel*")
text(-14 -120 6 floor(trip))
text(-38 -140 4 "* 5% added for T/O and climb")
text(-38 -125 6 "alternate")
text(-14 -125 6 floor(alternate))
text(-38 -130 6 "reserve")
text(-14 -130 6 floor(reserve))
text(-38 -135 6 "total fuel")
text(-14 -135 6 floor(trip + alternate + reserve))
line(-20 -131 -5 -131)
line(-20 -136 -5 -136)
#### GLIDE ####
line(23 -116 23 -136)
def a = 0.001645
text(0 -114 4 "glide distance in NM / feet")
#4000 = 5.2 v 1/8
text(0 -120 6 "4000")
def a40 = floor(4000 * a * glide)
text(12 -120 6 a40 / 10)
text(0 -125 6 "3000")
def a30 = floor(3000 * a * glide)
text(12 -125 6 a30 / 10)
text(0 -130 6 "2000")
def a20 = floor(2000 * a * glide)
text(12 -130 6 a20 / 10)
text(0 -135 6 "1000")
def a10 = floor(1000 * a * glide)
text(12 -135 6 a10 / 10)
text(27 -120 6 "3500")
def a35 = floor(3500 * a * glide)
text(40 -120 6 a35 / 10)
text(27 -125 6 "2500")
def a25 = floor(2500 * a * glide)
text(40 -125 6 a25 / 10)
text(27 -130 6 "1500")
def a15 = floor(1500 * a * glide)
text(40 -130 6 a15 / 10)
text(27 -135 6 "500")
def a5 = floor(500 * a * glide)
text(40 -135 6 a5 / 10)
############ ARTWORK ##############
#### HEADER ####
text(-18 122 8 "VFR FLIGHT")
text(-18 115 10 "PLANNER")
line(14 125 14 94) # vertLine
text(-37 96 6 pilot) #PILOT
text(18 123 5.5 "FROM:")
text(32 122 7 from) #FROM
text(48 123 5.5 "TO:")
text(60 122 7 to) #TO
text(18 116 5.5 "TAS:")
text(32 116 7 tas)
text(42 116 5.5 "KTS")
text(18 111 5.5 "FUEL")
text(32 111 7 lph) #FUEL
text(42 111 5.5 "L/H")
text(18 106 5.5 "GLIDE")
text(32 106 7 "1 /")
text(42 106 7 glide) #GLIDE RATIO
text(51 118 4 "tacho prior:")
text(51 110 4 "tacho after:")
line(50 112.5 90 112.5)
text(55 97 7 reg) #A/C REGISTRATION
text(33 101 4 "AIRBORNE") #AIRBORNE
line(32 104 90 104)
line(32 94 32 104)
line(50 94 50 120)
#### DRAW GRAPHICS FOR EACH WAYPOINT ####
repeat 0 to 6 using i {
def a = i * -29 # wpt entry height
#LINEART
line(-40 a + 94 90 a + 94) #main seperators
line(-40 a + 64.7 90 a + 64.7) #main seperators
line(-40 a + 84 50 a + 84) #sub 1
line(-40 a + 74 50 a + 74) #sub 1
#explanations
text(-40 a + 81 3.5 "TT")
text(-21 a + 81 3.5 "TH")
text(-40 a + 71 3.5 "WCA")
text(-21 a + 71 4.5 "MH")
text( -3 a + 81 3.5 "DIST,INT")
text( -3 a + 71 3.5 "DIST,ACC")
text( 15 a + 91 3.5 "GS")
text( 15 a + 81 3.5 "TIME,INT")
text( 15 a + 71 3.5 "TIME,ACC")
text( 33 a + 91 3.5 "ETA")
text( 33 a + 81 3.5 "ATA")
text( 33 a + 71 3.5 "DIFF")
text( -3 a + 91 3.5 "wind: ____/___ ")
#grid
line(32 a + 94 32 a + 84) # GS / WIND sep lines
line(14 a + 94 14 a + 84) # GS / WIND sep lines
repeat 0 to 4 using j {
def q = 18 * j
line(q - 22 a + 84 q - 22 a + 65)
}
#notes
text(52 a + 91 4 "shorthand/notes")
text(-40 a + 89 7 i + 1 ) # wpt number
}
line(50 94 50 -140) # right line
#footer
line(-40 -110 90 -110)
######### LEFT SIDE: frequencies ##########
line(-41 126 -41 -140)
text(-83 120 7 "FREQUENCIES")
repeat -16 to 19 using i {
line(-80 i * -7 -43 i * -7)
}
def step = 7
def offset = -13
#INFORMATION
text(-83 offset + step * 18 5 "information")
text(-80 offset + step * 17 5 "COIF EAST: 127.075")
text(-80 offset + step * 16 5 "COIF WEST: 129.475")
#APPROACH
text(-83 offset + step * 14 5 "approach")
text(-80 offset + step * 13 5 "EKAH APP: 119.275")
text(-80 offset + step * 12 5 "EKKA APP: 120.425")
text(-80 offset + step * 11 5 "EKYT APP: 123.975")
text(-80 offset + step * 10 5 "EKBI APP: 127.575")
text(-80 offset + step * 9 5 "EKRK APP: 125.525")
#TOWER
text(-83 offset + step * 7 5 "tower")
text(-80 offset + step * 6 5 "EKAH TWR: 127.075")
text(-80 offset + step * 5 5 "EKKA TWR: 119.575")
text(-80 offset + step * 4 5 "EKYT TWR: 118.300")
text(-80 offset + step * 3 5 "EKBI TWR: 119.000")
text(-80 offset + step * 2 5 "EKRK TWR: 118.900")
#RADIO
text(-83 offset + step * 0 5 "radio")
text(-80 offset + step * -1 5 "EKRD: 122.075")
text(-80 offset + step * -2 5 "EKVB: 123.500")
#AFIS
text(-83 offset + step * -5 5 "afis")
text(-80 offset + step * -6 5 "EKVJ: 121.400")
text(-80 offset + step * -7 5 "EKEB: 120.150")
text(-80 offset + step * -8 5 "EKSB: 126.400")
#ATIS
text(-83 offset + step * -10 5 "atis")
text(-80 offset + step * -11 5 "EKBI: 118.775")
text(-80 offset + step * -12 5 "EKYT: 120.475")
text(-80 offset + step * -13 5 "EKRK: 123.800")
#EMERGENCY
text(-83 offset + step * -15 5 "emergency")
text(-80 offset + step * -16 5 "Emergency freq: 121.5")
###### MINUTE MARKS ######
#def speedMin = speedMin / 5
#def speedMax = speedMax / 5
#def xStart = -85
#def dist = speedMax - speedMin
#def distance = 10 / dist
#repeat speedMin to speedMax using i {
# def x1 = xStart
#def x2 = xStart - distance
#def speed1 = i * 1852
#def speed1div = speed1 * 5
#def speed1min = speed1div / 6
#def speed1mm = speed1min * 100
#def plusOne = i + 1
#def speed2 = plusOne * 1852
#def speed2div = speed2 * 5
#def speed2min = speed2div / 6
#def speed2mm = speed2min * 100
# scale down to the paper scale
#def s1 = speed1mm / scale
#def s2 = speed2mm / scale
#def a = scale / 1300
#def extend = a / i
#minute lines - right side
#repeat 1 to extend using j {
# line(x1 s1 * j x2 s2 * j)
#}
#def s1l = s1 * -1
#def s2l = s2 * -1
# repeat 1 to extend using j {
# line(x1 s1l * j x2 s2l * j)
#}
#line(x1 -125 x1 125)#speed lines
#text(x1 10 textSize i) #show knots
#def xStart = xStart - distance
#}
#text(-95 -130 5 speedMax * 5)
#text(-88 -130 5 speedMin * 5)
#line(-95 0 -85 0)
#line(-95 -125 -95 125)
#call wind rose function from flightplanFunctions
#crossWindRose(landingRwyHdg 70 -126)