-
Notifications
You must be signed in to change notification settings - Fork 0
/
riseset.ijs
1383 lines (1079 loc) · 43.3 KB
/
riseset.ijs
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
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
NB.*riseset s-- compute rise, transit and set times of IAU named stars.
NB.
NB. verbatim: interface word(s):
NB. ------------------------------------------------------------------------------
NB. baby_today - named Babylonian stars rising/setting today
NB. fmt_today - format today verbs result
NB. iau_today - named IAU stars rising/setting today
NB. loadstars - loads riseset star data
NB. nav_today - named navigation stars rising/setting today
NB. navdaylist - sky safari 6_0 observing list of today's navigation stars
NB. riseset - rise, transit, set times of stars
NB.
NB. created: 2023mar09
NB. changes: ---------------------------------------------------------------------
NB. 23mar29 (iau_tonight) renamed (iau_today)
NB. 23mar29 various location setting verbs (location_uluru) added
NB. 23mar30 (nav_today) added
NB. 23apr01 (fmt_today) added
NB. 23apr06 (navdaylist) added
NB. 23apr08 (baby_today) added
NB. 23apr27 show sunrise/set times added (localsun)
coclass 'riseset'
(9!:11) 16 NB. high print precision
NB.*end-header
NB. carriage return character
CR=:13{a.
NB. minutes before and after sunset (0=ignore sun)
DARKTRS=:60
NB. seconds per day
DAYSECS=:86400
NB. interface words (IFACEWORDSriseset) group
IFACEWORDSriseset=:<;._1 ' baby_today fmt_today iau_today loadstars nav_today navdaylist riseset'
NB. current Julian date
JULIAN=:2460030.5
NB. line feed character
LF=:10{a.
NB. horizon limit in degrees
LIMITHORZ=:20
NB. limiting magnitude
LIMITMAG=:3.
NB. Name/description of observer location
LOCATIONNAME=:'Meridian'
NB. indicates sun never rises or sets in (sunriseset0) and (sunriseset1) results
NORISESET=:99
NB. approximate epoch J2000 obliquity of the ecliptic degrees, minutes, seconds
OBLIQUITYDMS2000=:23 26 21.4480000000000004
NB. observer latitude longitude, west longitudes negative
OBSLOCATION=:_116.375956000000002 43.6467749999999981
NB. root words (ROOTWORDSriseset) group
ROOTWORDSriseset=:<;._1 ' IFACEWORDSriseset ROOTWORDSriseset VMDriseset baby_today fmt_today iau_today location_uluru location_yellowstone navdaylist'
NB. standard altitude stars - compensates for horizon atmospheric refraction
STDALTITUDE=:0.566699999999999982
NB. UTC time zone offset in hours
UTCOFFSET=:6
NB. version, make count and date
VMDriseset=:'0.9.85';15;'18 Aug 2024 10:16:12'
NB. retains string after first occurrence of (x)
afterstr=:] }.~ #@[ + 1&(i.~)@([ E. ])
NB. all zero, first, second, ... nth differences of nl: alldifs ?.10#100
alldifs=:([: >: [: i. [: - #) {.&.> [: <"1 (}. - }:)^:(i.@#@[)
apparRADEC=:4 : 0
NB.*apparRADEC v-- apparent RA and DEC for epoch (x) from J2000.0
NB. RA and DEC.
NB.
NB. This verb adjusts J2000 RA and DEC coordinates to another
NB. epoch. The method is based on Meeus (20.3) pg 126. This
NB. calculation ignores stellar proper motions and assumes that
NB. (y) RA DEC values are J2000.0. The resulting positions are
NB. accurate enough for basic rise, transit, and set
NB. calculations.
NB.
NB. dyad: ft =. flYmd apparRADEC ftRADEC
NB.
NB. 2028 11 13.19 apparRADEC 41.054063 ,. 49.227750
NB.
NB. ({."1 ciau)=: {:"1 ciau
NB. 2023 4 22 apparRADEC RA_J2000 ,: Dec_J2000
'zet z th'=. zetzthT0 x NB. final epoch t
'ra dec'=. y NB. J2000 ra,dec
NB. meeus (20.4) pg. 126
A=. (cosd dec)*sind ra + zet
B=. ((cosd th)*(cosd dec)*cosd ra + zet) - (sind th)*sind dec
C=. ((sind th)*(cosd dec)*cosd ra + zet) + (cosd th)*sind dec
NB. NIMP star close celestial poles
NB. new dec,ra
ran=. z + atan2 A ,: B [ decn=. dfr arcsin C
ran ,: decn
)
NB. seconds correction apparent sidereal time - meeus pg. 84 - (Δpsi * cos(eps))/15
apparsecs=:15 %~ (3600 * nutation_longitude_dPsi) * [: cosd meanobliquityjd0
NB. apparent Greenwich sidereal - hms: apparsidjd0 julfrcal |: 2023 1 3,:1991 2 8.5
apparsidjd0=:([: dmsfrdd 15 %~ [: nth0 meansidjd0) + 0 0 ,"1 [: ,. apparsecs
NB. applies the verb in string (x) to (y)
apply=:128!:2
NB. arc cosine
arccos=:_2&o.
NB. arc sine
arcsin=:_1&o.
NB. arc tangent
arctan=:_3&o.
NB. signal with optional message
assert=:0 0"_ $ 13!:8^:((0: e. ])`(12"_))
atan2=:3 : 0
NB.*atan2 v-- arctangent of (Y % X) in degrees.
NB.
NB. FORTRAN (ATN2) variation of the standard (arctan) (_3&o.) for
NB. ratios. Based on a PASCAL function from Astronomy on the
NB. Personal Computer by Montenbruck and Pfleger ISBN
NB. 0-387-52754-0 pg. 9.
NB.
NB. Result is between _180 <: atan2 <: 180 degrees
NB.
NB. monad: fl =. atan2 flYX
NB.
NB. atan2 1 ,: 1 NB. 45 degrees
NB. atan2 1 ,: %: 3 NB. 30 degrees
NB.
NB. NB. random ratios comparing two atan2 verbs
NB. r=: ?. 2 500$50
NB. r=: r * ($r) $ (?.~ */$r) { (*/$r)$_1 1
NB. (atan2b |.r) -: atan2 r
NB.
NB. NB. surprisingly (atan2) is faster than (atan2b)
NB. NB. (j 9.41 2023) but (atan2b) consumes less memory
NB. NB. 1000 ts"1 'atan2b r',:'atan2 |.r'
NB. vector J NB. scalar PASCAL
rad=. 0.0174532925199432955 NB. CONST RAD=0.0174532925199433;
r=. 0 #~ {: $y
b0=. *./0=y NB. IF (X=0.0) AND (Y=0.0) THEN ATN2:= 0.0
ir=. i. #r=. 0 (I. b0)} r
if. +./b1=. -.b0 do.
t=. |(I. b1) {"1 y NB. AX=: ABS(X); AY=: ABS(Y)
it=. (I. b1) { ir
b2=. (1{t) > 0{t NB. IF (AX>AY) THEN PHI=: ARCTAN(AY/AX)/RAD
s=. (I. b2) {"1 t
r=. (rad %~ arctan %/s) (b2#it)} r
s=. (I. -.b2) {"1 t NB. ELSE PHI=: 90.0-ARCTAN(AX/AY)/RAD;
r=. (90 - rad %~ arctan %/ |.s) (it #~ -.b2)} r
end.
xl0=. I. b1 *. (1{y) < 0 NB. IF (X<0.0) THEN PHI=: 180.0-PHI;
r=. (180 - xl0{r) (xl0)} r
yl0=. I. b1 *. (0{y) < 0 NB. IF (Y<0.0) THEN PHI=: -PHI;
(-yl0{r) (yl0)} r
)
baby_today=:3 : 0
NB.*baby_today v-- named Babylonian stars rising/setting today.
NB.
NB. monad: (bt ; clLoc ; itRs ; flParms) =. baby_today uuIgnore
jd=. julfrcal ymd=. 3 {. 6!:0 ''
(ymd;jd;OBSLOCATION;UTCOFFSET;LIMITMAG;LIMITHORZ;LOCATIONNAME;DARKTRS) baby_today y
:
NB. star data
({."1 IAU)=. {:"1 IAU [ 'IAU NAV'=. loadstars 0
bs=. babylonian_named_stars 0
NB. !(*)=. IAU_Name Designation
'Rs lName sRs cParms'=. x today_calc }. 0 {"1 bs
NB. include Designation names
Rs=. 1 0 2 3 {"1 Rs ,.~ (IAU_Name i. 0 {"1 Rs){Designation
Rs;lName;sRs;cParms
)
babylonian_named_stars=:3 : 0
NB.*babylonian_named_stars v-- identified Babylonian stars approx
NB. 1500 BCE.
NB.
NB. Stars with modern names identified from ancient Babylonian
NB. tablets. Most stars will be shining long after we are gone.
NB. It's fun to seek out stars that the ancients found important
NB. enough to catalog. Source data comes from a spreadsheet TAB
NB. here:
NB.
NB. https://www.iau.org/public/themes/naming_stars/
NB.
NB. monad: bt=. babylonian_named_stars uuIgnore
NB. load babylonian stars !(*)=. HIP IAU_Name jpath
bs=. parsebomcsv read jpath '~addons/jacks/testdata/babylonian_normal_stars.csv'
NB. cross reference with current names
(0 {"1 ciau)=. 1 {"1 ciau [ 'ciau cnavs'=. loadstars 0
bs=. bs #~ 1,HIP e.~ }. 0 {"1 bs
ix=. HIP i. }. 0{"1 bs
bs=. ('IAU_Name';ix{IAU_Name) ,. bs
NB. remove columns without names
bs #"1~ ] 0 < #&> 0 { bs
)
NB. retains string before first occurrence of (x)
beforestr=:] {.~ 1&(i.~)@([ E. ])
NB. boxes open nouns
boxopen=:<^:(L. = 0:)
cold_iau_named_stars=:3 : 0
NB.*cold_iau_named_stars v-- convert IAU btcl to column dictionary.
NB.
NB. monad: bt =. cold_iau_named_stars btcl
NB.
NB. iau=. ; {: , > {: 4 get 'iau_named_stars_2022_txt'
NB. ciau=. cold_iau_named_stars parse_iau_named_stars iau
NB.
NB. NB. define columns
NB. (0 {"1 ciau)=: 1 {"1 ciau
c=. 0{"1 t=. |: y
p0=. c i. ;:'Vmag RA_J2000 Dec_J2000'
d=. _999&".&> p0 { t=. }."1 t
'invalid mag, ra, dec' assert -. _999 e. d
p1=. c i. ;:'IAU_Name Designation HIP Bayer_Name'
c ,. (<"1 ] p1 { t) , <"1 d
)
NB. cosine radians
cos=:2&o.
NB. cosine degrees
cosd=:cos@rfd
NB. character table to newline delimited list
ctl=:}.@(,@(1&(,"1)@(-.@(*./\."1@(=&' '@])))) # ,@((10{a.)&(,"1)@]))
darktransits=:4 : 0
NB.*darktransits v-- mask selecting transits before and after sunset.
NB.
NB. dyad: pl =. itHrmn darktransits (itSrs ; iaMins)
NB.
NB. 'Riseset Location cParms'=. (location_yellowstone~ 1935 7 6) nav_today 0
NB. srs=. localsun 1935 7 6
NB. (>{:"1 Riseset) darktransits srs;60
NB. sun rise/set in day minutes - dark minutes
'srs bam'=. y
if. (NORISESET,1) -: 0{srs do. 0 #~ #x NB. sun is always up
elseif. (NORISESET,0) -: 0{srs do. 1 #~ #x NB. sun is always down
elseif. do.
NB. transit times in day minutes and before/after set minutes
rs=. dmfrhm x [ 'sr ss'=. dmfrhm srs
NB. transits occurring when sufficently dark
(rs < 0 >. sr - bam) +. rs > 1440 <. ss + bam
end.
)
NB. decimal degrees from degrees, minutes, seconds - inverse (dmsfrdd)
ddfrdms=:(60"_ #. ]) % 3600"_
deltaT0=:3 : 0
NB.*deltaT0 v-- dynamical time ΔT in seconds.
NB.
NB. Returns the difference in seconds between UT and TD based on
NB. polynomial expressions by Espenak and Meesus. This
NB. calculation is useful for the years -1999 to 3000: a five
NB. thousand year period.
NB.
NB. see: https://eclipse.gsfc.nasa.gov/SEhelp/deltatpoly2004.html
NB.
NB. also in (futs): nasa_polynomial_expressions_for_delta_t_md
NB.
NB. monad: flSecs =. deltaT0 flYd
NB.
NB. ymd=. |: (3 {. 6!:0 ''), _1812 3 12 , _12 12 11 , 2137 12 13, 1700 1 1 ,: 35 7 6
NB. |: ymd , deltaT0 deltaTdy ymd
NB. (ry) time intervals are (l,u]
NB. before -500:
NB. ΔT = -20 + 32 * u^2; where: u = (y-1820)/100
ry=. ,: _1999 _500
t1=. {{ _20 + 32 * U^2 [ U=. (y - 1820) % 100 }}
NB. between -500 and +500:
NB. ΔT = 10583.6 - 1014.41 * u + 33.78311 * u^2 - 5.952053 * u^3
NB. - 0.1798452 * u^4 + 0.022174192 * u^5 + 0.0090316521 * u^6; where: u = y/100
NB. NOTE: for the year -500 set value of 17190 to 17203.7
ry=. ry , _500 500
t2=. {{ 10583.6 - (1014.41*U) + (33.78311*U^2) - (5.952053*U^3) - (0.1798452*U^4) + (0.022174192*U^5) + 0.0090316521*U^6 [ U=. y % 100 }}
NB. between +500 and +1600:
NB. ΔT = 1574.2 - 556.01 * u + 71.23472 * u^2 + 0.319781 * u^3
NB. - 0.8503463 * u^4 - 0.005050998 * u^5 + 0.0083572073 * u^6; where: u = (y-1000)/100
ry=. ry , 500 1600
t3=. {{ 1574.2 - (556.01*U) + (71.23472*U^2) + (0.319781*U^3) - (0.8503463*U^4) - (0.005050998*U^5) + 0.0083572073*U^6 [ U=. (y-1000) % 100 }}
NB. between +1600 and +1700:
NB. ΔT = 120 - 0.9808 * t - 0.01532 * t^2 + t^3 / 7129; where: t = y - 1600
ry=. ry , 1600 1700
t4=. {{ 120 - (0.9808*t) - (0.01532*t^2) + (t^3)%7129 [ t=. y - 1600 }}
NB. between +1700 and +1800:
NB. ΔT = 8.83 + 0.1603 * t - 0.0059285 * t^2 + 0.00013336 * t^3 - t^4 / 1174000; where: t = y - 1700
ry=. ry , 1700 1800
t5=. {{ 8.83 + (0.1603*t) - (0.0059285*t^2) + (0.00013336*t^3) - (t^4)%1174000 [ t=. y - 1700 }}
NB. between +1800 and +1860:
NB. ΔT = 13.72 - 0.332447 * t + 0.0068612 * t^2 + 0.0041116 * t^3 - 0.00037436 * t^4
NB. + 0.0000121272 * t^5 - 0.0000001699 * t^6 + 0.000000000875 * t^7; where: t = y - 1800
ry =. ry , 1800 1860
t6=. {{ 13.72 - (0.332447*t) + (0.0068612*t^2) + (0.0041116*t^3) - (0.00037436*t^4) + (0.0000121272*t^5) - (0.0000001699*t^6) + 0.000000000875*t^7 [ t=. y - 1800 }}
NB. between 1860 and 1900:
NB. ΔT = 7.62 + 0.5737 * t - 0.251754 * t^2 + 0.01680668 * t^3
NB. - 0.0004473624 * t^4 + t^5 / 233174; where: t = y - 1860
ry=. ry , 1860 1900
t7=. {{ 7.62 + (0.5737*t) - (0.251754*t^2) + (0.01680668*t^3) - (0.0004473624*t^4) + (t^5)%233174 [ t=. y - 1860 }}
NB. between 1900 and 1920:
NB. ΔT = -2.79 + 1.494119 * t - 0.0598939 * t^2 + 0.0061966 * t^3 - 0.000197 * t^4; where: t = y - 1900
ry=. ry , 1900 1920
t8=. {{ -2.79 + (1.494119*t) - (0.0598939*t^2) + (0.0061966*t^3) - 0.000197*t^4 [ t=. y - 1900 }}
NB. between 1920 and 1941:
NB. ΔT = 21.20 + 0.84493*t - 0.076100 * t^2 + 0.0020936 * t^3; where: t = y - 1920
ry=. ry , 1920 1941
t9=. {{ 21.20 + (0.84493*t) - (0.076100*t^2) + 0.0020936*t^3 [ t=. y - 1920 }}
NB. between 1941 and 1961:
NB. ΔT = 29.07 + 0.407*t - t^2/233 + t^3 / 2547; where: t = y - 1950
ry=. ry , 1941 1961
t10=. {{ 29.07 + 0.407*t - ((t^2)%233) + (t^3)%2547 [ t=. y - 1950 }}
NB. between 1961 and 1986:
NB. ΔT = 45.45 + 1.067*t - t^2/260 - t^3 / 718 ; where: t = y - 1975
ry=. ry , 1961 1986
t11=. {{ 45.45 + (1.067*t) - ((t^2)%260) - (t^3)%718 [ t=. y - 1975 }}
NB. between 1986 and 2005:
NB. ΔT = 63.86 + 0.3345 * t - 0.060374 * t^2 + 0.0017275 * t^3 + 0.000651814 * t^4
NB. + 0.00002373599 * t^5; where: t = y - 2000
ry=. ry , 1986 2005
t12=. {{ 63.86 + (0.3345*t) - (0.060374*t^2) + (0.0017275*t^3) + (0.000651814*t^4) + 0.00002373599*t^5 [ t=. y - 2000 }}
NB. between 2005 and 2050:
NB. ΔT = 62.92 + 0.32217 * t + 0.005589 * t^2; where: t = y - 2000
ry=. ry , 2005 2050
t13=. {{ 62.92 + (0.32217*t) + 0.005589*t^2 [ t=. y - 2000 }}
NB. between 2050 and 2150:
NB. ΔT = -20 + 32 * ((y-1820)/100)^2 - 0.5628 * (2150 - y)
ry=. ry , 2050 2150
t14=. {{ _20 + (32 * ((y-1820)%100)^2) - 0.5628 * 2150 - y }}
NB. after 2150:
NB. ΔT = -20 + 32 * u^2; where: u = (y-1820)/100
ry=. ry , 2150 3000
t15=. {{ _20 + 32 * U^2 [ U=. (y-1820)%100 }}
NB. NOTE: the t(i) verbs match the intervals
ti=. (rb=. /:~ ~. ,ry) I. y
'year range _1999 to 3000 exceeded' assert -.(0,#rb) e. ti
NB. t(i) gerund
tg=. t1`t2`t3`t4`t5`t6`t7`t8`t9`t10`t11`t12`t13`t14`t15
NB. apply t(i) verbs to appropriate intervals
(;ti </. i.#y) { ;(tg {~ <: ~.ti) apply&.> ti </. y
)
NB. delta ΔT decimal year: deltaTdy 2023 3 12 ,. 1959 12 11
deltaTdy=:(0 { ]) + 12 %~ 0.5 -~ 1 { ]
NB. degrees from radian
dfr=:*&57.2957795130823229
NB. day minutes from hour minute time: dmfrhm 6 51 ,: 20 39
dmfrhm=:[: +/"1 [: ] 60 1 *"1 ]
NB. degrees, minutes, seconds from decimal degrees - inverse (ddfrdms)
dmsfrdd=:<. (,.) 60 60 #: 3600 * 1 | ,
fmt_today=:3 : 0
NB.*fmt_today v-- format today verbs result.
NB.
NB. monad: cl =. fmt_today (bt ; cl ; fl)
NB.
NB. fmt_today nav_today 0
NB. fmt_today (location_yellowstone~ 1935 7 6) iau_today 0
'Rs lName sRs cParms'=. y
NB. calc parameters
hdr=. <;._1' Location Sunrise Sunset Mag-Lim Above-Horz Dusk-Min Julian ΔT Longitude Latitude Year Month Day.dd UTCz'
cParms=. ctl ": <(rjust lName , (":sRs) , ": ,. cParms) ,. ' ' ,. >hdr
NB. rise/set - sorted by transit time
Rs=. >&.> <"1 |: Rs
Rs=. (('5.1'&(8!:2)@,.) &.> 2 { Rs) (2)} Rs
Rs=. ('3.0'&(8!:2)&.> 3 { Rs) (3)} Rs
Rs=. ctl ": Rs ,:~ <;._1' Name Designation Tr-Alt-Deg Tr-24-HrMin'
cParms,LF,Rs
)
NB. fractional centuries from epoch J2000 Meeus pg. 83: gT0jd julfrcal 1957 10 4.81
gT0jd=:36525 %~ 2451545. -~ ]
NB. fractional centuries from epoch J2000 Meeus pg. 83: gT0ymd 1957 10 4.81
gT0ymd=:36525 %~ 2451545. -~ julfrcal
NB. hours, minutes from decimal seconds: hmfrds dsfrhms 20 27 43.23
hmfrds=:[: 24 60&#: 60 %~ ]
iau_today=:3 : 0
NB.*iau_today v-- named IAU stars rising/setting today.
NB.
NB. monad: (bt ; clLoc ; itSrs ; flParms) =. iau_today uuIgnore
NB.
NB. iau_today 0
NB.
NB. dyad: (bt ; clLoc ; itSrs ; flParms) =. blYmd_LB_U0_LMAG_LHORZ_LOC iau_today uuIgnore
NB.
NB. 'Riseset Location sRs cParms'=. (location_yellowstone~ 1935 7 6) iau_today 0
jd=. julfrcal ymd=. 3 {. 6!:0 ''
(ymd;jd;OBSLOCATION;UTCOFFSET;LIMITMAG;LIMITHORZ;LOCATIONNAME;DARKTRS) iau_today y
:
NB. date, julian, location, UTC timezone, magnitude, horizon, location, dusk mins
'YMD JD LB UO LMAG LHORZ LOCNAME DARK'=. x
NB. star data
'IAU NAV'=. loadstars 0
({."1 NAV)=. {:"1 NAV [ ({."1 IAU)=. {:"1 IAU
NB. brighter magnitude limit !(*)=. Vmag IAU_Name Designation
'Rs lName sRs cParms'=. x today_calc (LMAG > Vmag) # IAU_Name
NB. include Designation names
Rs=. 1 0 2 3 {"1 Rs ,.~ (IAU_Name i. 0 {"1 Rs){Designation
Rs;lName;sRs;cParms
)
intr3p=:4 : 0
NB.*intr3p v-- interpolate three values - meeus pg 25.
NB.
NB. dyad: fln intr3p fl
NB.
NB. NB. meeus pg. 24
NB. yi=. 0.884226 0.877366 0.870531
NB. 0.05 intr3p yi
NB. y = y2 + (n/2)(a + b nc)
NB. a b c are differences
'only 3 values' assert 3=#y
d=. 1 2{alldifs y
'a b'=. >0{d [ c=. ,/ >1{d
(1{y) + (x%2) * a + b + x*c
)
julfrcal=:3 : 0
NB.*julfrcal v-- Julian dates from calendar dates.
NB.
NB. Astronomical Julian date. Similiar to (tojulian) but handles
NB. the fact that Julian days start at noon rather than midnight
NB. for calendar days.
NB.
NB. monad: fl =. julfrcal ilYYYYMMDD | ftYYYYMMDD
NB.
NB. julfrcal 2001 9 11
NB. julfrcal 1776 1941 1867 , 7 12 7 ,: 4 7 1
NB.
NB. NB. Meeus (Astronomical Algorithms) test cases (pg. 61)
NB. NB. NOTE: the fractional day representation of time
NB. 2436116.31 = julfrcal 1957 10 4.81 NB. 7.a Sputnik 1
NB. 1842713.0 = julfrcal 333 1 27.5 NB. 7.b
NB.
NB. NB. zero date is roughly the age of the oldest bristlecone pines (coincidence?)
NB. julfrcal -4711 10 29.5
NB. vector J NB. scalar BASIC
'y m d'=. y NB. INPUT "Y,M,D ";Y,M,D
g=. 1582 <: y NB. G=1: IF Y<1582 THEN G=0
f=. (d - d1) - 0.5 [ d1=. <. d NB. D1=INT(D): F=D-D1-0.5
j=. - <. 7 * 4 %~ <.y + 12 %~ m+9 NB. J=-INT(7*(INT((M+9)/12)+Y)/4)
NB. IF G=0 THEN 805
s=. * m-9 [ a=. | m-9 NB. S=SGN(M-9): A=ABS(M-9)
j3=. <. y + s * <. a%7 NB. J3=INT(Y+S*INT(A/7))
j3=. - <. 3r4 * >: <. j3 % 100 NB. J3=-INT((INT(J3/100)+1)*3/4)
j=. j + (<.275 * m%9) + d1 + g*j3 NB. 805 J=J+INT(275*M/9)+D1+G*J3
j=. j + 1721027 + (2*g) + 367*y NB. J=J+1721027+2*G+367*Y
b=. f >: 0 NB. IF F>=0 THEN 825
f=. f + b [ j=. j - b NB. F=F+1: J=J-1
f + j
)
NB. left justify table
ljust=:' '&$: :(] |."_1~ i."1&0@(] e. [))
loadstars=:3 : 0
NB.*loadstars v-- loads riseset star data.
NB.
NB. monad: blIAU_Nav =. loadstars uuIgnore
NB.
NB. loadstars 0
NB.
NB. dyad: blIAU_Nav=. pa loadstars uuIgnore
NB.
NB. 0 loadstars 0 NB. files
NB. 1 loadstars 0 NB. JOD
NB.
NB. loadstars~ 0 NB. idiom files
NB. loadstars~ 1 NB. idiom JOD
NB.
NB. 2 loadstars 0 NB. files - define columns
0 loadstars y
:
'invalid option' assert x e. 0 1 2
if. x e. 0 2 do.
NB. load star data from addon directory !(*)=. jpath
paddon=. jpath '~addons/jacks/testdata/'
ciau=. read paddon,'iau_named_stars_2022.txt'
cnavs=. read paddon,'Navigation_Stars.txt'
elseif. x-:1 do.
NB. load star data from JOD (futs) !(*)=. get od require
rc=. od ;:'futs utils' [ 3 od '' [ require 'general/jod'
ciau=. ; {: , > {: MACRO_ajod_ get 'iau_named_stars_2022_txt'
cnavs=. ; {: , > {: MACRO_ajod_ get 'Navigation_Stars_txt'
end.
ciau=. cold_iau_named_stars parse_iau_named_stars ciau
cnavs=. parsetd cnavs -. CR
cnavs=. (0 { cnavs) ,. <"1 |: }. cnavs
'star column overlap' assert 0 = #(0 {"1 cnavs) ([ -. -.) 0 {"1 ciau
NB. define columns - override mixed assignments (<:)=:
if. x-:2 do.
(0 {"1 ciau)=: 1 {"1 ciau
(0 {"1 cnavs)=: 1 {"1 cnavs
(<ciau),(<cnavs),<(0 {"1 ciau),0 {"1 cnavs
else.
(<ciau),<cnavs
end.
)
localsun=:3 : 0
NB.*localsun v-- location sun rise/set times in hour minutes.
NB.
NB. monad: itRs =. localsun blLB_UO_YMD
NB.
NB. localsun OBSLOCATION;UTCOFFSET;6!:0 ''
'LB UO YMD'=. y
_2 ]\ ,sunriseset1 (|.LB),UO,1 |. 3 {. YMD
)
location_home=:3 : 0
NB.*location_home v-- set parameters for "home" location.
NB.
NB. monad: bl =. location_home uuIgnore
NB.
NB. location_home 0
NB. NB. uses location with current date
NB. fmt_today iau_today 0
NB.
NB. dyad: bl =. flYmfd location_home uuIgnore
NB.
NB. NB. uses location with home date
NB. (location_home 0) iau_today 0
NB. (location_home 0) nav_today 0
NB.
NB. NB. arbitrary dates for location
NB. fmt_today (1712 3 15.34 location_home 0) nav_today 0
NB. fmt_today (location_home~ 1933 9 25.75) iau_today 0
NB. test date https://www.almanac.com/astronomy/bright-stars/zipcode/83646/2023-03-27
2023 3 27 location_home y
:
JULIAN_riseset_=: julfrcal ymd=. x
NB. longitude, latitude with standard signs
OBSLOCATION_riseset_=: _116.375956 43.646775
LOCATIONNAME_riseset_=: 'Home - Meridian'
UTCOFFSET_riseset_=: 6.0 NB. MST time zone
LIMITMAG_riseset_=: 3.0 NB. stellar magnitude
LIMITHORZ_riseset_=: 20 NB. degrees above horizon
DARKTRS_riseset_=: 60 NB. minutes before and after sunset (0=ignore sun)
ymd;JULIAN;OBSLOCATION;UTCOFFSET;LIMITMAG;LIMITHORZ;LOCATIONNAME;DARKTRS
)
location_uluru=:3 : 0
NB.*location_uluru v-- set parameters for Uluru location.
NB.
NB. monad: location_uluru uuIgnore
NB.
NB. location_uluru 0
NB. NB. uses location with current date
NB. iau_today 0
NB.
NB. dyad: bl =. flYmfd location_uluru uuIgnore
NB.
NB. NB. uses location with uluru date
NB. (location_uluru 0) iau_today 0
NB.
NB. NB. arbitrary dates for location
NB. fmt_today (1712 3 15.34 location_uluru 0) nav_today 0
NB. fmt_today (location_uluru~ 1933 9 25.75) iau_today 0
2022 10 19 location_uluru y
:
JULIAN_riseset_=: julfrcal ymd=. x
NB. longitude, latitude with standard signs
OBSLOCATION_riseset_=: 131.01941 _25.34301
LOCATIONNAME_riseset_=: 'Uluru - star party diner'
UTCOFFSET_riseset_=: _9.5 NB. time zone
LIMITMAG_riseset_=: 6.0 NB. stellar magnitude
LIMITHORZ_riseset_=: 5 NB. degrees above horizon
DARKTRS_riseset_=: 0 NB. minutes before and after sunset (0=ignore sun)
ymd;JULIAN;OBSLOCATION;UTCOFFSET;LIMITMAG;LIMITHORZ;LOCATIONNAME;DARKTRS
)
location_yellowstone=:3 : 0
NB.*location_yellowstone v-- set parameters for Old Faithful location.
NB.
NB. monad: location_yellowstone uuIgnore
NB.
NB. location_yellowstone 0
NB. NB. uses location with current date
NB. iau_today 0
NB.
NB. dyad: bl =. flYmfd location_yellowstone uuIgnore
NB.
NB. NB. uses location with yellowstone date
NB. (location_yellowstone 0) iau_today 0
NB.
NB. NB. arbitrary dates for location
NB. fmt_today (1712 3 15.34 location_yellowstone 0) nav_today 0
NB. fmt_today (location_yellowstone~ 1933 9 25.75) iau_today 0
2013 5 7 location_yellowstone y
:
JULIAN_riseset_=: julfrcal ymd=. x
NB. longitude, latitude with standard signs
OBSLOCATION_riseset_=: _110.82792 44.46057
LOCATIONNAME_riseset_=: 'Yellowstone - Old Faithful'
UTCOFFSET_riseset_=: 6.0 NB. MST time zone
LIMITMAG_riseset_=: 6.0 NB. stellar magnitude
LIMITHORZ_riseset_=: 10 NB. degrees above horizon
DARKTRS_riseset_=: 0 NB. minutes before and after sunset (0=ignore sun)
ymd;JULIAN;OBSLOCATION;UTCOFFSET;LIMITMAG;LIMITHORZ;LOCATIONNAME;DARKTRS
)
meanobliquityT0=:3 : 0
NB.*meanobliquityT0 v-- mean obliquity of the ecliptic IAU in degrees.
NB.
NB. monad: fl =. meanobliquityT0 flT
NB. units are decimal arc seconds
ea=. +/3600 60 1 * OBLIQUITYDMS2000
NB. meeus (21.2) pg. 135
3600 %~ ea - (46.8150*y) - (0.00059*y^2) + 0.001813*y^3
)
meanobliquityT1=:3 : 0
NB.*meanobliquityT1 v-- mean obliquity of the ecliptic Laskar in
NB. degrees.
NB.
NB. Mean obliquity using Laskar's polynomial. This expression is
NB. more accurate than (meanobliquityT0): see Meeus (21.2) pg.
NB. 135.
NB.
NB. monad: fl =. meanobliquityT1 flT
NB. units are decimal arc seconds
ea=. +/3600 60 1 * OBLIQUITYDMS2000
NB. time units 10000 Julian years
U=. y % 100
e0=. (39.05*U^6) + (7.12*U^7) + (27.87*U^8) + (5.79*U^9) + 2.45*U^10
3600 %~ ea - (4680.93*U) - (1.55*U^2) + (1999.25*U^3) - (51.38*U^4) - (249.67*U^5) - e0
)
meanobliquityjd0=:3 : 0
NB.*meanobliquityjd0 v-- mean obliquity ecliptic for Julian date (y) degrees.
NB.
NB. monad: fl =. meanobliquityjd0 flJD
NB.
NB. NB. meeus pg. 136
NB. e0=. ,dmsfrdd meanobliquityjd0 2446895.5
NB.
NB. NB. matches to 3 decimals
NB. 23 26 27.407 -: 0.001 round e0
NB.
NB. dyad: fl =. pa meanobliquityjd0 flJD
NB.
NB. NB. Laskar algorithm
NB. el=. ,dmsfrdd 1 meanobliquityjd0 2446895.5
0 meanobliquityjd0 y
:
meanobliquityT0`meanobliquityT1@.(x) gT0jd y
)
meansid0=:4 : 0
NB.*meansid0 v-- mean sidereal time at Greenwich for T (x) JD (y).
NB.
NB. dyad: flDegs =. flT meansid flJD
NB. meeus (11.4) pg 84
280.46061837 + (360.98564736629 * y - 2451545.0) + (0.000387933 * x^2) - 38710000 %~ x^3
)
meansidjd0=:3 : 0
NB.*meansidjd0 v-- mean sidereal time at Greenwich for julian day (y) in degrees.
NB.
NB. monad: fl =. meansidjd0 flJD
NB.
NB. NB. julian day for April 10, 1987 19h:24m:00s UT
NB. JD=. julfrcal 1987 4,10 + fdfrhms 19 21 0
NB. meansidjd0 JD
(gT0jd y) meansid0 y
)
nav_today=:3 : 0
NB.*nav_today v-- named navigation stars rising/setting today.
NB.
NB. monad: (bt ; clLoc ; itSrs ; flParms) =. nav_today uuIgnore
NB.
NB. nav_today 0
NB.
NB. dyad: (bt ; clLoc ; itSrs; flParms) =. blYmd_LB_U0_LMAG_LHORZ_LOC nav_today uuIgnore
NB.
NB. 'Riseset Location sRs cParms'=. (location_yellowstone~ 1935 7 6) nav_today 0
jd=. julfrcal ymd=. 3 {. 6!:0 ''
(ymd;jd;OBSLOCATION;UTCOFFSET;LIMITMAG;LIMITHORZ;LOCATIONNAME;DARKTRS) nav_today y
:
NB. star data
'IAU NAV'=. loadstars 0
({."1 NAV)=. {:"1 NAV [ ({."1 IAU)=. {:"1 IAU
NB. !(*)=. Nav_Star_Name IAU_Name Designation
'Rs lName sRs cParms'=. x today_calc Nav_Star_Name
NB. include Designation names
Rs=. 1 0 2 3 {"1 Rs ,.~ (IAU_Name i. 0 {"1 Rs){Designation
Rs;lName;sRs;cParms
)
navdaylist=:3 : 0
NB.*navdaylist v-- sky safari 6_0 observing list of today's navigation stars.
NB.
NB. The files created by this verb can be loaded into the Sky
NB. Safari iOS and Mac apps.
NB.
NB. monad: cl =. navdaylist uuIgnore
NB.
NB. navhome=. navdaylist 0
NB. navhome write jpath '~JODIMEX/Navigation_Stars_Home.skylist'
NB. j profile !(*)=. jpath
skl=. read jpath'~addons/jacks/testdata/Navigation_Stars.skylist'
'st loc cParms'=. nav_today 0 [ location_home 0
NB. skylist header
cst=. 'SortedBy=Default Order'
hdr=. cst ((,&LF)@[ ,~ beforestr) skl
NB. cut skylist objects
sob=. (] <;.1~ 'SkyObject=BeginObject' E. ]) cst afterstr skl
NB. retain objects that match star and hdr names
b=. +./ (0 {"1 st) +./@E.&>"0 1 sob
sob=. sob #~ b *. +./ (1 {"1 st) +./@E.&>"0 1 sob
NB. reset sort order
sob=. ];._2 tlf ;sob
ix=. I. +./"1 (,:'DefaultIndex=') E. sob
ns=. '='&beforestr"1 ix{sob
ns=. ns ,. '=' ,. ljust ": ,. i. #ns
hdr,ctl >(<"1 ns) (ix)} <"1 sob
)
NB. normalize negative degree sidereal time: nnth0 -1677831.2621266
nnth0=:] + 360 * [: | [: (<.) 360 %~ ]
NB. normalize positive degree sidereal time: npth0 1677831.2621266
npth0=:] - 360 * [: (<.) 360 %~ ]
NB. normalize degree sidereal time: nth0 _35555 77777
nth0=:npth0`nnth0@.(0&>:@[)
nutation_longitude_dPsi=:3 : 0
NB.*nutation_longitude_dPsi v-- nutation in ecliptical longitude in degrees (1980 iau theory).
NB.
NB. NOTE: the pseudo-code is vector ready and easily converted to J.
NB.
NB. verbatim: algorithm from Jay Tanner https://neoprogrammics.com/nutations/
NB.
NB. see: nutation_in_longitude_dPsi_md
NB.
NB. monad: flDeg =. nutation_longitude_dPsi flJD
NB.
NB. ymd=. |: 2023 3 12 , 1959 12 11 , 2135 12 13, 1700 1 1 ,: 1935 7 6
NB. JD=. julfrcal ymd NB. no delT adj.
NB. 2460015.5 = 0{JD
NB. nutation_longitude_dPsi JD
NB.
NB. NB. see (futs) test: (riseset_tanner_smoke) for examples
T=. (y - 2451545) % 36525 NB. T = (JD - 2451545) / 36525
T2=. T*T NB. T2 = T*T
T3=. T*T2 NB. T3 = T*T2
NB. DegToRad = 3.1415926535897932 / 180
DegToRad=. 3.1415926535897932 % 180
NB. w1 = 297.85036 + 445267.11148*T - 0.0019142*T2 + (T3 / 189474)
w1=. 297.85036 + (445267.11148*T) - (0.0019142*T2) + (T3 % 189474)
w1=. DegToRad*(w1) NB. w1 = DegToRad*(w1)
NB. w2 = 357.52772 + 35999.05034*T - 0.0001603*T2 - (T3 / 300000)
w2=. 357.52772 + (35999.05034*T) - (0.0001603*T2) - (T3 % 300000)
w2=. DegToRad*(w2) NB. w2 = DegToRad*(w2)
NB. w3 = 134.96298 + 477198.867398*T + 0.0086972*T2 + (T3 / 56250)
w3=. 134.96298 + (477198.867398*T) + (0.0086972*T2) + (T3 % 56250)
w3=. DegToRad*(w3) NB. w3 = DegToRad*(w3)
NB. w4 = 93.27191 + 483202.017538*T - 0.0036825*T2 + (T3 / 327270)
w4=. 93.27191 + (483202.017538*T) - (0.0036825*T2) + (T3 % 327270)
w4=. DegToRad*(w4) NB. w4 = DegToRad*(w4)
NB. w5 = 125.04452 - 1934.136261*T + 0.0020708*T2 + (T3 / 450000)
w5=. 125.04452 - (1934.136261*T) + (0.0020708*T2) + (T3 % 450000)
w5=. DegToRad*(w5) NB. w5 = DegToRad*(w5)
w=. (sin w5)*((_174.2*T) - 171996) NB. w = sin(w5)*(-174.2*T - 171996)
w=. w + (sin 2 * w4 + w5 - w1)*((_1.6*T) - 13187) NB. w = w + sin(2*(w4 + w5 - w1))*(-1.6*T - 13187)
w=. w + (sin 2 * w4 + w5)*(_2274 - 0.2*T) NB. w = w + sin(2*(w4 + w5))*(-2274 - 0.2*T)
w=. w + (sin 2 * w5)*((0.2*T) + 2062) NB. w = w + sin(2 * w5)*(0.2*T + 2062)
w=. w + (sin w2)*(1426 - 3.4*T) NB. w = w + sin(w2)*(1426 - 3.4*T)
w=. w + (sin w3)*((0.1*T) + 712) NB. w = w + sin(w3)*(0.1*T + 712)
NB. w = w + sin(2*(w4 + w5 - w1) + w2)*(1.2*T - 517)
w=. w + (sin (2 * w4 + w5 - w1) + w2)*((1.2*T) - 517)
w=. w + (sin (2*w4) + w5)*((_0.4*T) - 386) NB. w = w + sin(2 * w4 + w5)*(-0.4*T - 386)
NB. w = w + sin(2*(w4 + w5 - w1) - w2)*(217 - 0.5*T)
w=. w + (sin (2 * w4 + w5 - w1) - w2)*(217 - 0.5*T)
w=. w + (sin (2*w4 - w1) + w5)*(129 + 0.1*T) NB. w = w + sin(2*(w4 - w1) + w5)*(129 + 0.1*T)
w=. w + (sin w3 + w5)*((0.1*T) + 63) NB. w = w + sin(w3 + w5)*(0.1*T + 63)
w=. w + (sin w5 - w3)*((_0.1*T) - 58) NB. w = w + sin(w5 - w3)*(-0.1*T - 58)
w=. w + (sin 2*w2)*(17 - 0.1*T) NB. w = w + sin(2*w2)*(17 - 0.1*T)
w=. w + (sin 2 * w2 + w4 + w5 - w1)*((0.1*T) - 16) NB. w = w + sin(2*(w2 + w4 + w5 - w1))*(0.1*T - 16)
w=. w - 301*(sin (2 * w4 + w5) + w3) NB. w = w - 301*sin(2*(w4 + w5) + w3)
w=. w - 158*(sin w3 - 2*w1) NB. w = w - 158*sin(w3 - 2*w1)
w=. w + 123*(sin (2 * w4 + w5) - w3) NB. w = w + 123*sin(2*(w4 + w5) - w3)
w=. w + 63*(sin 2*w1) NB. w = w + 63*sin(2*w1)
w=. w - 59*(sin (2 * w1 + w4 + w5) - w3) NB. w = w - 59*sin(2*(w1 + w4 + w5) - w3)
w=. w - 51*(sin (2*w4) + w3 + w5) NB. w = w - 51*sin(2 * w4 + w3 + w5)
w=. w + 48*sin(2 * w3 - w1) NB. w = w + 48*sin(2*(w3 - w1))
w=. w + 46*(sin (2 * w4 - w3) + w5) NB. w = w + 46*sin(2*(w4 - w3) + w5)
w=. w - 38*(sin 2 * w1 + w4 + w5) NB. w = w - 38*sin(2*(w1 + w4 + w5))
w=. w - 31*(sin 2 * w3 + w4 + w5) NB. w = w - 31*sin(2*(w3 + w4 + w5))
w=. w + 29*(sin 2*w3) NB. w = w + 29*sin(2*w3)
w=. w + 29*(sin (2 * w4 + w5 - w1) + w3) NB. w = w + 29*sin(2*(w4 + w5 - w1) + w3)
w=. w + 26*(sin 2*w4) NB. w = w + 26*sin(2*w4)
w=. w - 22*(sin 2* w4 - w1) NB. w = w - 22*sin(2*(w4 - w1))
w=. w + 21*(sin (2*w4) + w5 - w3) NB. w = w + 21*sin(2*w4 + w5 - w3)
w=. w + 16*(sin (2*w1) - w3 + w5) NB. w = w + 16*sin(2*w1 - w3 + w5)
w=. w - 15*(sin w2 + w5) NB. w = w - 15*sin(w2 + w5)
w=. w - 13*(sin w3 + w5 - 2*w1) NB. w = w - 13*sin(w3 + w5 - 2*w1)
w=. w - 12*(sin w5 - w2) NB. w = w - 12*sin(w5 - w2)
w=. w + 11*(sin 2 * w3 - w4) NB. w = w + 11*sin(2*(w3 - w4))
w=. w - 10*(sin (2 * w4 + w1) + w5 - w3) NB. w = w - 10*sin(2*(w4 + w1) + w5 - w3)
w=. w - 8*(sin (2 * w4 + w1 + w5) + w3) NB. w = w - 8*sin(2*(w4 + w1 + w5) + w3)
w=. w + 7*(sin (2 * w4 + w5) + w2) NB. w = w + 7*sin(2*(w4 + w5) + w2)
w=. w - 7*(sin w3 - (2*w1) + w2) NB. w = w - 7*sin(w3 - 2*w1 + w2)
w=. w - 7*(sin (2 * w4 + w5) - w2) NB. w = w - 7*sin(2*(w4 + w5) - w2)
w=. w - 7*(sin (2*w1) + (2*w4) + w5) NB. w = w - 7*sin(2*w1 + 2*w4 + w5)
w=. w + 6*(sin (2*w1) + w3) NB. w = w + 6*sin(2*w1 + w3)
w=. w + 6*(sin 2 * w3 + w4 + w5 - w1) NB. w = w + 6*sin(2*(w3 + w4 + w5 - w1))
w=. w + 6*(sin (2 * w4 - w1) + w3 + w5) NB. w = w + 6*sin(2*(w4 - w1) + w3 + w5)
w=. w - 6*(sin (2 * w1 - w3) + w5) NB. w = w - 6*sin(2*(w1 - w3) + w5)
w=. w - 6*(sin (2*w1) + w5) NB. w = w - 6*sin(2*w1 + w5)
w=. w + 5*(sin w3 - w2) NB. w = w + 5*sin(w3 - w2)
w=. w - 5*(sin (2* w4 - w1) + w5 - w2) NB. w = w - 5*sin(2*(w4 - w1) + w5 - w2)
w=. w - 5*(sin w5 - 2*w1) NB. w = w - 5*sin(w5 - 2*w1)
w=. w - 5*(sin (2 * w3 + w4) + w5) NB. w = w - 5*sin(2*(w3 + w4) + w5)
w=. w + 4*(sin (2 * w3 - w1) + w5) NB. w = w + 4*sin(2*(w3 - w1) + w5)
w=. w + 4*(sin (2 * w4 - w1) + w2 + w5) NB. w = w + 4*sin(2*(w4 - w1) + w2 + w5)
w=. w + 4*(sin w3 - 2*w4) NB. w = w + 4*sin(w3 - 2*w4)
w=. w - 4*(sin w3 - w1) NB. w = w - 4*sin(w3 - w1)
w=. w - 4*(sin w2 - 2*w1) NB. w = w - 4*sin(w2 - 2*w1)
w=. w - 4*(sin w1) NB. w = w - 4*sin(w1)
w=. w + 3*(sin (2*w4) + w3) NB. w = w + 3*sin(2*w4 + w3)
w=. w - 3*(sin 2 * w4 + w5 - w3) NB. w = w - 3*sin(2*(w4 + w5 - w3))
w=. w - 3*(sin w3 - w1 - w2) NB. w = w - 3*sin(w3 - w1 - w2)
w=. w - 3*(sin w2 + w3) NB. w = w - 3*sin(w2 + w3)
w=. w - 3*(sin (2 * w4 + w5) + w3 - w2) NB. w = w - 3*sin(2*(w4 + w5) + w3 - w2)
w=. w - 3*(sin (2 * w1 + w4 + w5) - w2 - w3) NB. w = w - 3*sin(2*(w1 + w4 + w5) - w2 - w3)