-
Notifications
You must be signed in to change notification settings - Fork 7
/
JyotishFunctions.bas
2232 lines (1790 loc) · 61.3 KB
/
JyotishFunctions.bas
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
Attribute VB_Name = "JyotishFunctions"
'
' Swiss Ephemeris Release 1.60 9-jan-2000
'
' Declarations for Visual Basic 5.0
' The DLL file must exist in the same directory, or in a system
' directory where it can be found at runtime
'
Private Declare PtrSafe Function swe_azalt Lib "swedll64.dll" _
( _
ByVal tjd_ut As Double, _
ByVal calc_flag As Long, _
ByRef geopos As Double, _
ByVal atpress As Double, _
ByVal attemp As Double, _
ByRef xin As Double, _
ByRef xaz As Double _
) As Long 'geopos must be the first of three array elements
'xin must be the first of two array elements
'xaz must be the first of three array elements
Private Declare PtrSafe Function swe_azalt_rev Lib "swedll64.dll" _
( _
ByVal tjd_ut As Double, _
ByVal calc_flag As Long, _
ByRef geopos As Double, _
ByRef xin As Double, _
ByRef xout As Double _
) As Long 'geopos must be the first of three array elements
'xin must be the first of two array elements
'xout must be the first of three array elements
Private Declare PtrSafe Function swe_calc Lib "swedll64.dll" _
( _
ByVal tjd As Double, _
ByVal ipl As Long, _
ByVal iflag As Long, _
ByRef X As Double, _
ByVal serr As String _
) As Long ' x must be first of six array elements
' serr must be able to hold 256 bytes
Private Declare PtrSafe Function swe_calc_d Lib "swedll64.dll" _
( _
ByRef tjd As Double, _
ByVal ipl As Long, _
ByVal iflag As Long, _
ByRef X As Double, _
ByVal serr As String _
) As Long ' x must be first of six array elements
' serr must be able to hold 256 bytes
Private Declare PtrSafe Function swe_calc_ut Lib "swedll64.dll" _
( _
ByVal tjd_ut As Double, _
ByVal ipl As Long, _
ByVal iflag As Long, _
ByRef X As Double, _
ByVal serr As String _
) As Long ' x must be first of six array elements
' serr must be able to hold 256 bytes
Private Declare PtrSafe Function swe_calc_ut_d Lib "swedll64.dll" _
( _
ByRef tjd_ut As Double, _
ByVal ipl As Long, _
ByVal iflag As Long, _
ByRef X As Double, _
ByVal serr As String _
) As Long ' x must be first of six array elements
' serr must be able to hold 256 bytes
Private Declare PtrSafe Function swe_close Lib "swedll64.dll" _
( _
) As Long
Private Declare PtrSafe Function swe_close_d Lib "swedll64.dll" _
( _
ByVal ivoid As Long _
) As Long ' argument ivoid is ignored
Private Declare PtrSafe Sub swe_cotrans Lib "swedll64.dll" _
( _
ByRef xpo As Double, _
ByRef xpn As Double, _
ByVal eps As Double _
)
Private Declare PtrSafe Function swe_cotrans_d Lib "swedll64.dll" _
( _
ByRef xpo As Double, _
ByRef xpn As Double, _
ByRef eps As Double _
) As Long
Private Declare PtrSafe Sub swe_cotrans_sp Lib "swedll64.dll" _
( _
ByRef xpo As Double, _
ByRef xpn As Double, _
ByVal eps As Double _
)
Private Declare PtrSafe Function swe_cotrans_sp_d Lib "swedll64.dll" _
( _
ByRef xpo As Double, _
ByRef xpn As Double, _
ByRef eps As Double _
) As Long
Private Declare PtrSafe Sub swe_cs2degstr Lib "swedll64.dll" _
( _
ByVal t As Long, _
ByVal S As String _
)
Private Declare PtrSafe Function swe_cs2degstr_d Lib "swedll64.dll" _
( _
ByVal t As Long, _
ByVal S As String _
) As Long
Private Declare PtrSafe Sub swe_cs2lonlatstr Lib "swedll64.dll" _
( _
ByVal t As Long, _
ByVal pchar As Byte, _
ByVal mchar As Byte, _
ByVal S As String _
)
Private Declare PtrSafe Function swe_cs2lonlatstr_d Lib "swedll64.dll" _
( _
ByVal t As Long, _
ByRef pchar As Byte, _
ByRef mchar As Byte, _
ByVal S As String _
) As Long
Private Declare PtrSafe Sub swe_cs2timestr Lib "swedll64.dll" _
( _
ByVal t As Long, _
ByVal sep As Long, _
ByVal supzero As Long, _
ByVal S As String _
)
Private Declare PtrSafe Function swe_cs2timestr_d Lib "swedll64.dll" _
( _
ByVal t As Long, _
ByVal sep As Long, _
ByVal supzero As Long, _
ByVal S As String _
) As Long
Private Declare PtrSafe Function swe_csnorm Lib "swedll64.dll" _
( _
ByVal P As Long _
) As Long
Private Declare PtrSafe Function swe_csnorm_d Lib "swedll64.dll" _
( _
ByVal P As Long _
) As Long
Private Declare PtrSafe Function swe_csroundsec Lib "swedll64.dll" _
( _
ByVal P As Long _
) As Long
Private Declare PtrSafe Function swe_csroundsec_d Lib "swedll64.dll" _
( _
ByVal P As Long _
) As Long
Private Declare PtrSafe Function swe_d2l Lib "swedll64.dll" _
( _
) As Long
Private Declare PtrSafe Function swe_d2l_d Lib "swedll64.dll" _
( _
) As Long
Private Declare PtrSafe Function swe_date_conversion Lib "swedll64.dll" _
( _
ByVal Year As Long, _
ByVal Month As Long, _
ByVal Day As Long, _
ByVal utime As Double, _
ByVal cal As Byte, _
ByRef tjd As Double _
) As Long
Private Declare PtrSafe Function swe_date_conversion_d Lib "swedll64.dll" _
( _
ByVal Year As Long, _
ByVal Month As Long, _
ByVal Day As Long, _
ByRef utime As Double, _
ByRef cal As Byte, _
ByRef tjd As Double _
) As Long
Private Declare PtrSafe Function swe_day_of_week Lib "swedll64.dll" _
( _
ByVal JD As Double _
) As Long
Private Declare PtrSafe Function swe_day_of_week_d Lib "swedll64.dll" _
( _
ByRef JD As Double _
) As Long
Private Declare PtrSafe Function swe_degnorm Lib "swedll64.dll" _
( _
ByVal JD As Double _
) As Double
Private Declare PtrSafe Function swe_degnorm_d Lib "swedll64.dll" _
( _
ByRef JD As Double _
) As Long
Private Declare PtrSafe Function swe_deltat Lib "swedll64.dll" _
( _
ByVal JD As Double _
) As Double
Private Declare PtrSafe Function swe_deltat_d Lib "swedll64.dll" _
( _
ByRef JD As Double, _
ByRef deltat As Double _
) As Long
Private Declare PtrSafe Function swe_difcs2n Lib "swedll64.dll" _
( _
ByVal p1 As Long, _
ByVal p2 As Long _
) As Long
Private Declare PtrSafe Function swe_difcs2n_d Lib "swedll64.dll" _
( _
ByVal p1 As Long, _
ByVal p2 As Long _
) As Long
Private Declare PtrSafe Function swe_difcsn Lib "swedll64.dll" _
( _
ByVal p1 As Long, _
ByVal p2 As Long _
) As Long
Private Declare PtrSafe Function swe_difcsn_d Lib "swedll64.dll" _
( _
ByVal p1 As Long, _
ByVal p2 As Long _
) As Long
Private Declare PtrSafe Function swe_difdeg2n Lib "swedll64.dll" _
( _
ByVal p1 As Double, _
ByVal p2 As Double _
) As Double
Private Declare PtrSafe Function swe_difdeg2n_d Lib "swedll64.dll" _
( _
ByRef p1 As Double, _
ByRef p2 As Double, _
ByRef Diff As Double _
) As Long
Private Declare PtrSafe Function swe_difdegn Lib "swedll64.dll" _
( _
ByVal p1 As Double, _
ByVal p2 As Double _
) As Long
Private Declare PtrSafe Function swe_difdegn_d Lib "swedll64.dll" _
( _
ByRef p1 As Double, _
ByRef p2 As Double, _
ByRef Diff As Double _
) As Long
Private Declare PtrSafe Function swe_fixstar Lib "swedll64.dll" _
( _
ByVal star As String, _
ByVal tjd As Double, _
ByVal iflag As Long, _
ByRef X As Double, _
ByVal serr As String _
) As Long ' x must be first of six array elements
' serr must be able to hold 256 bytes
' star must be able to hold 40 bytes
Private Declare PtrSafe Function swe_fixstar_d Lib "swedll64.dll" _
( _
ByVal star As String, _
ByRef tjd As Double, _
ByVal iflag As Long, _
ByRef X As Double, _
ByVal serr As String _
) As Long ' x must be first of six array elements
' serr must be able to hold 256 bytes
' star must be able to hold 40 bytes
Private Declare PtrSafe Function swe_fixstar_ut Lib "swedll64.dll" _
( _
ByVal star As String, _
ByVal tjd_ut As Double, _
ByVal iflag As Long, _
ByRef X As Double, _
ByVal serr As String _
) As Long ' x must be first of six array elements
' serr must be able to hold 256 bytes
' star must be able to hold 40 bytes
Private Declare PtrSafe Function swe_fixstar_ut_d Lib "swedll64.dll" _
( _
ByVal star As String, _
ByRef tjd_ut As Double, _
ByVal iflag As Long, _
ByRef X As Double, _
ByVal serr As String _
) As Long ' x must be first of six array elements
' serr must be able to hold 256 bytes
' star must be able to hold 40 bytes
Private Declare PtrSafe Function swe_get_ayanamsa Lib "swedll64.dll" _
( _
ByVal tjd_et As Double _
) As Double
Private Declare PtrSafe Function swe_get_ayanamsa_d Lib "swedll64.dll" _
( _
ByRef tjd_et As Double, _
ByRef ayan As Double _
) As Long
Private Declare PtrSafe Function swe_get_ayanamsa_ut Lib "swedll64.dll" _
( _
ByVal tjd_ut As Double _
) As Double
Private Declare PtrSafe Function swe_get_ayanamsa_ut_d Lib "swedll64.dll" _
( _
ByRef tjd_ut As Double, _
ByRef ayan As Double _
) As Long
Private Declare PtrSafe Sub swe_get_planet_name Lib "swedll64.dll" _
( _
ByVal ipl As Long, _
ByVal pname As String _
)
Private Declare PtrSafe Function swe_get_planet_name_d Lib "swedll64.dll" _
( _
ByVal ipl As Long, _
ByVal pname As String _
) As Long
Private Declare PtrSafe Function swe_get_tid_acc Lib "swedll64.dll" _
( _
) As Double
Private Declare PtrSafe Function swe_get_tid_acc_d Lib "swedll64.dll" _
( _
ByRef X As Double _
) As Long
Private Declare PtrSafe Function swe_houses Lib "swedll64.dll" _
( _
ByVal tjd_ut As Double, _
ByVal geolat As Double, _
ByVal geolon As Double, _
ByVal ihsy As Long, _
ByRef hcusps As Double, _
ByRef ascmc As Double _
) As Long ' hcusps must be first of 13 array elements
' ascmc must be first of 10 array elements
Private Declare PtrSafe Function swe_houses_d Lib "swedll64.dll" _
( _
ByRef tjd_ut As Double, _
ByRef geolat As Double, _
ByRef geolon As Double, _
ByVal ihsy As Long, _
ByRef hcusps As Double, _
ByRef ascmc As Double _
) As Long ' hcusps must be first of 13 array elements
' ascmc must be first of 10 array elements
Private Declare PtrSafe Function swe_houses_ex Lib "swedll64.dll" _
( _
ByVal tjd_ut As Double, _
ByVal iflag As Long, _
ByVal geolat As Double, _
ByVal geolon As Double, _
ByVal ihsy As Long, _
ByRef hcusps As Double, _
ByRef ascmc As Double _
) As Long ' hcusps must be first of 13 array elements
' ascmc must be first of 10 array elements
Private Declare PtrSafe Function swe_houses_ex_d Lib "swedll64.dll" _
( _
ByRef tjd_ut As Double, _
ByVal iflag As Long, _
ByRef geolat As Double, _
ByRef geolon As Double, _
ByVal ihsy As Long, _
ByRef hcusps As Double, _
ByRef ascmc As Double _
) As Long ' hcusps must be first of 13 array elements
' ascmc must be first of 10 array elements
Private Declare PtrSafe Function swe_houses_armc Lib "swedll64.dll" _
( _
ByVal armc As Double, _
ByVal geolat As Double, _
ByVal eps As Double, _
ByVal ihsy As Long, _
ByRef hcusps As Double, _
ByRef ascmc As Double _
) As Long ' hcusps must be first of 13 array elements
' ascmc must be first of 10 array elements
Private Declare PtrSafe Function swe_houses_armc_d Lib "swedll64.dll" _
( _
ByRef armc As Double, _
ByRef geolat As Double, _
ByRef eps As Double, _
ByVal ihsy As Long, _
ByRef hcusps As Double, _
ByRef ascmc As Double _
) As Long ' hcusps must be first of 13 array elements
' ascmc must be first of 10 array elements
Private Declare PtrSafe Function swe_house_pos Lib "swedll64.dll" _
( _
ByVal armc As Double, _
ByVal geolat As Double, _
ByVal eps As Double, _
ByVal ihsy As Long, _
ByRef xpin As Double, _
ByVal serr As String _
) As Double
' xpin must be first of 2 array elements
Private Declare PtrSafe Function swe_house_pos_d Lib "swedll64.dll" _
( _
ByRef armc As Double, _
ByRef geolat As Double, _
ByRef eps As Double, _
ByVal ihsy As Long, _
ByRef xpin As Double, _
ByRef hpos As Double, _
ByVal serr As String _
) As Long
' xpin must be first of 2 array elements
Private Declare PtrSafe Function swe_julday Lib "swedll64.dll" _
( _
ByVal Year As Long, _
ByVal Month As Long, _
ByVal Day As Long, _
ByVal hour As Double, _
ByVal gregflg As Long _
) As Double
Private Declare PtrSafe Function swe_julday_d Lib "swedll64.dll" _
( _
ByVal Year As Long, _
ByVal Month As Long, _
ByVal Day As Long, _
ByRef hour As Double, _
ByVal gregflg As Long, _
ByRef tjd As Double _
) As Long
Private Declare PtrSafe Function swe_lun_eclipse_how Lib "swedll64.dll" _
( _
ByVal tjd_ut As Double, _
ByVal ifl As Long, _
ByRef geopos As Double, _
ByRef attr As Double, _
ByVal serr As String _
) As Long
Private Declare PtrSafe Function swe_lun_eclipse_how_d Lib "swedll64.dll" _
( _
ByRef tjd_ut As Double, _
ByVal ifl As Long, _
ByRef geopos As Double, _
ByRef attr As Double, _
ByVal serr As String _
) As Long
Private Declare PtrSafe Function swe_lun_eclipse_when Lib "swedll64.dll" _
( _
ByVal tjd_start As Double, _
ByVal ifl As Long, _
ByVal ifltype As Long, _
ByRef tret As Double, _
ByVal backward As Long, _
ByVal serr As String _
) As Long
Private Declare PtrSafe Function swe_lun_eclipse_when_d Lib "swedll64.dll" _
( _
ByRef tjd_start As Double, _
ByVal ifl As Long, _
ByVal ifltype As Long, _
ByRef tret As Double, _
ByVal backward As Long, _
ByVal serr As String _
) As Long
Private Declare PtrSafe Function swe_nod_aps Lib "swedll64.dll" _
( _
ByVal tjd_et As Double, _
ByVal ipl As Long, _
ByVal iflag As Long, _
ByVal method As Long, _
ByRef xnasc As Double, _
ByRef xndsc As Double, _
ByRef xperi As Double, _
ByRef xaphe As Double, _
ByVal serr As String _
) As Long
Private Declare PtrSafe Function swe_nod_aps_ut Lib "swedll64.dll" _
( _
ByVal tjd_ut As Double, _
ByVal ipl As Long, _
ByVal iflag As Long, _
ByVal method As Long, _
ByRef xnasc As Double, _
ByRef xndsc As Double, _
ByRef xperi As Double, _
ByRef xaphe As Double, _
ByVal serr As String _
) As Long
Private Declare PtrSafe Function swe_pheno Lib "swedll64.dll" _
( _
ByVal tjd As Double, _
ByVal ipl As Long, _
ByVal iflag As Long, _
ByRef attr As Double, _
ByVal serr As String _
) As Long
Private Declare PtrSafe Function swe_pheno_ut Lib "swedll64.dll" _
( _
ByVal tjd As Double, _
ByVal ipl As Long, _
ByVal iflag As Long, _
ByRef attr As Double, _
ByVal serr As String _
) As Long
Private Declare PtrSafe Function swe_pheno_d Lib "swedll64.dll" _
( _
ByRef tjd As Double, _
ByVal ipl As Long, _
ByVal iflag As Long, _
ByRef attr As Double, _
ByVal serr As String _
) As Long
Private Declare PtrSafe Function swe_pheno_ut_d Lib "swedll64.dll" _
( _
ByRef tjd As Double, _
ByVal ipl As Long, _
ByVal iflag As Long, _
ByRef attr As Double, _
ByVal serr As String _
) As Long
Private Declare PtrSafe Function swe_refrac Lib "swedll64.dll" _
( _
ByVal inalt As Double, _
ByVal atpress As Double, _
ByVal attemp As Double, _
ByVal calc_flag As Long _
) As Double
Private Declare PtrSafe Sub swe_revjul Lib "swedll64.dll" _
( _
ByVal tjd As Double, _
ByVal gregflg As Long, _
ByRef Year As Long, _
ByRef Month As Long, _
ByRef Day As Long, _
ByRef hour As Double _
)
Private Declare PtrSafe Function swe_revjul_d Lib "swedll64.dll" _
( _
ByRef tjd As Double, _
ByVal gregflg As Long, _
ByRef Year As Long, _
ByRef Month As Long, _
ByRef Day As Long, _
ByRef hour As Double _
) As Long
Private Declare PtrSafe Function swe_rise_trans Lib "swedll64.dll" _
( _
ByVal tjd_ut As Double, _
ByVal ipl As Long, _
ByVal starname As String, _
ByVal epheflag As Long, _
ByVal rsmi As Long, _
ByRef geopos As Double, _
ByVal atpress As Double, _
ByVal attemp As Double, _
ByRef tret As Double, _
ByVal serr As String _
) As Long
Private Declare PtrSafe Sub swe_set_ephe_path Lib "swedll64.dll" _
( _
ByVal path As String _
)
Private Declare PtrSafe Function swe_set_ephe_path_d Lib "swedll64.dll" _
( _
ByVal path As String _
) As Long
Private Declare PtrSafe Sub swe_set_jpl_file Lib "swedll64.dll" _
( _
ByVal file As String _
)
Private Declare PtrSafe Function swe_set_jpl_file_d Lib "swedll64.dll" _
( _
ByVal file As String _
) As Long
Private Declare PtrSafe Function swe_set_sid_mode Lib "swedll64.dll" _
( _
ByVal sid_mode As Long, _
ByVal t0 As Double, _
ByVal ayan_t0 As Double _
) As Long
Private Declare PtrSafe Function swe_set_sid_mode_d Lib "swedll64.dll" _
( _
ByVal sid_mode As Long, _
ByRef t0 As Double, _
ByRef ayan_t0 As Double _
) As Long
Private Declare PtrSafe Function swe_set_topo Lib "swedll64.dll" _
( _
ByVal geolon As Double, _
ByVal geolat As Double, _
ByVal altitude As Double _
)
Private Declare PtrSafe Function swe_set_topo_d Lib "swedll64.dll" _
( _
ByRef geolon As Double, _
ByRef geolat As Double, _
ByRef altitude As Double _
)
Private Declare PtrSafe Sub swe_set_tid_acc Lib "swedll64.dll" _
( _
ByVal X As Double _
)
Private Declare PtrSafe Function swe_set_tid_acc_d Lib "swedll64.dll" _
( _
ByRef X As Double _
) As Long
Private Declare PtrSafe Function swe_sidtime0 Lib "swedll64.dll" _
( _
ByVal tjd_ut As Double, _
ByVal ecl As Double, _
ByVal nut As Double _
) As Double
Private Declare PtrSafe Function swe_sidtime0_d Lib "swedll64.dll" _
( _
ByRef tjd_ut As Double, _
ByRef ecl As Double, _
ByRef nut As Double, _
ByRef sidt As Double _
) As Long
Private Declare PtrSafe Function swe_sidtime Lib "swedll64.dll" _
( _
ByVal tjd_ut As Double _
) As Double
Private Declare PtrSafe Function swe_sidtime_d Lib "swedll64.dll" _
( _
ByRef tjd_ut As Double, _
ByRef sidt As Double _
) As Long
Private Declare PtrSafe Function swe_sol_eclipse_how Lib "swedll64.dll" _
( _
ByVal tjd_ut As Double, _
ByVal ifl As Long, _
ByRef geopos As Double, _
ByRef attr As Double, _
ByVal serr As String _
) As Long
Private Declare PtrSafe Function swe_sol_eclipse_how_d Lib "swedll64.dll" _
( _
ByRef tjd_ut As Double, _
ByVal ifl As Long, _
ByRef geopos As Double, _
ByRef attr As Double, _
ByVal serr As String _
) As Long
Private Declare PtrSafe Function swe_sol_eclipse_when_glob Lib "swedll64.dll" _
( _
ByVal tjd_start As Double, _
ByVal ifl As Long, _
ByVal ifltype As Long, _
ByRef tret As Double, _
ByVal backward As Long, _
ByVal serr As String _
) As Long
Private Declare PtrSafe Function swe_sol_eclipse_when_glob_d Lib "swedll64.dll" _
( _
ByRef tjd_start As Double, _
ByVal ifl As Long, _
ByVal ifltype As Long, _
ByRef tret As Double, _
ByVal backward As Long, _
ByVal serr As String _
) As Long
Private Declare PtrSafe Function swe_sol_eclipse_when_loc Lib "swedll64.dll" _
( _
ByVal tjd_start As Double, _
ByVal ifl As Long, _
ByRef tret As Double, _
ByRef attr As Double, _
ByVal backward As Long, _
ByVal serr As String _
) As Long
Private Declare PtrSafe Function swe_sol_eclipse_when_loc_d Lib "swedll64.dll" _
( _
ByRef tjd_start As Double, _
ByVal ifl As Long, _
ByRef tret As Double, _
ByRef attr As Double, _
ByVal backward As Long, _
ByVal serr As String _
) As Long
Private Declare PtrSafe Function swe_sol_eclipse_where Lib "swedll64.dll" _
( _
ByVal tjd_ut As Double, _
ByVal ifl As Long, _
ByRef geopos As Double, _
ByRef attr As Double, _
ByVal serr As String _
) As Long
Private Declare PtrSafe Function swe_sol_eclipse_where_d Lib "swedll64.dll" _
( _
ByRef tjd_ut As Double, _
ByVal ifl As Long, _
ByRef geopos As Double, _
ByRef attr As Double, _
ByVal serr As String _
) As Long
Private Declare PtrSafe Function swe_time_equ Lib "swedll64.dll" _
( _
ByVal tjd_ut As Double, _
ByRef E As Double, _
ByRef serr As String _
) As Long
' values for gregflag in swe_julday() and swe_revjul()
Const SE_JUL_CAL As Integer = 0
Const SE_GREG_CAL As Integer = 1
' planet and body numbers (parameter ipl) for swe_calc()
Const SE_SUN As Integer = 0
Const SE_MOON As Integer = 1
Const SE_MERCURY As Integer = 2
Const SE_VENUS As Integer = 3
Const SE_MARS As Integer = 4
Const SE_JUPITER As Integer = 5
Const SE_SATURN As Integer = 6
Const SE_URANUS As Integer = 7
Const SE_NEPTUNE As Integer = 8
Const SE_PLUTO As Integer = 9
Const SE_MEAN_NODE As Integer = 10
Const SE_TRUE_NODE As Integer = 11
Const SE_MEAN_APOG As Integer = 12
Const SE_OSCU_APOG As Integer = 13
Const SE_EARTH As Integer = 14
Const SE_CHIRON As Integer = 15
Const SE_PHOLUS As Integer = 16
Const SE_CERES As Integer = 17
Const SE_PALLAS As Integer = 18
Const SE_JUNO As Integer = 19
Const SE_VESTA As Integer = 20
Const SE_NPLANETS As Integer = 21
Const SE_AST_OFFSET As Integer = 10000
' Hamburger or Uranian ficticious "planets"
Const SE_FICT_OFFSET As Integer = 40
Const SE_FICT_MAX As Integer = 999 'maximum number for ficticious planets
'if taken from file seorbel.txt
Const SE_NFICT_ELEM As Integer = 15 'number of built-in ficticious planets
Const SE_CUPIDO As Integer = 40
Const SE_HADES As Integer = 41
Const SE_ZEUS As Integer = 42
Const SE_KRONOS As Integer = 43
Const SE_APOLLON As Integer = 44
Const SE_ADMETOS As Integer = 45
Const SE_VULKANUS As Integer = 46
Const SE_POSEIDON As Integer = 47
' other ficticious bodies
Const SE_ISIS As Integer = 48
Const SE_NIBIRU As Integer = 49
Const SE_HARRINGTON As Integer = 50
Const SE_NEPTUNE_LEVERRIER As Integer = 51
Const SE_NEPTUNE_ADAMS As Integer = 52
Const SE_PLUTO_LOWELL As Integer = 53
Const SE_PLUTO_PICKERING As Integer = 54
' points returned by swe_houses() and swe_houses_armc()
' in array ascmc(0...10)
Const SE_ASC As Integer = 0
Const SE_MC As Integer = 1
Const SE_ARMC As Integer = 2
Const SE_VERTEX As Integer = 3
Const SE_EQUASC As Integer = 4 ' "equatorial ascendant"
Const SE_NASCMC As Integer = 5 ' number of such points
' iflag values for swe_calc()/swe_calc_ut() and swe_fixstar()/swe_fixstar_ut()
Const SEFLG_JPLEPH As Long = 1
Const SEFLG_SWIEPH As Long = 2
Const SEFLG_MOSEPH As Long = 4
Const SEFLG_SPEED As Long = 256
Const SEFLG_HELCTR As Long = 8
Const SEFLG_TRUEPOS As Long = 16
Const SEFLG_J2000 As Long = 32
Const SEFLG_NONUT As Long = 64
Const SEFLG_NOGDEFL As Long = 512
Const SEFLG_NOABERR As Long = 1024
Const SEFLG_EQUATORIAL As Long = 2048
Const SEFLG_XYZ As Long = 4096
Const SEFLG_RADIANS As Long = 8192
Const SEFLG_BARYCTR As Long = 16384
Const SEFLG_TOPOCTR As Long = 32768
Const SEFLG_SIDEREAL As Long = 65536
'eclipse codes
Const SE_ECL_CENTRAL As Long = 1
Const SE_ECL_NONCENTRAL As Long = 2
Const SE_ECL_TOTAL As Long = 4
Const SE_ECL_ANNULAR As Long = 8
Const SE_ECL_PARTIAL As Long = 16
Const SE_ECL_ANNULAR_TOTAL As Long = 32
Const SE_ECL_PENUMBRAL As Long = 64
Const SE_ECL_VISIBLE As Long = 128
Const SE_ECL_MAX_VISIBLE As Long = 256
Const SE_ECL_1ST_VISIBLE As Long = 512
Const SE_ECL_2ND_VISIBLE As Long = 1024
Const SE_ECL_3RD_VISIBLE As Long = 2048
Const SE_ECL_4TH_VISIBLE As Long = 4096
'sidereal modes, for swe_set_sid_mode()
Const SE_SIDM_FAGAN_BRADLEY As Long = 0
Const SE_SIDM_LAHIRI As Long = 1
Const SE_SIDM_DELUCE As Long = 2
Const SE_SIDM_RAMAN As Long = 3
Const SE_SIDM_USHASHASHI As Long = 4
Const SE_SIDM_KRISHNAMURTI As Long = 5
Const SE_SIDM_DJWHAL_KHUL As Long = 6
Const SE_SIDM_YUKTESHWAR As Long = 7
Const SE_SIDM_JN_BHASIN As Long = 8
Const SE_SIDM_BABYL_KUGLER1 As Long = 9
Const SE_SIDM_BABYL_KUGLER2 As Long = 10
Const SE_SIDM_BABYL_KUGLER3 As Long = 11
Const SE_SIDM_BABYL_HUBER As Long = 12
Const SE_SIDM_BABYL_ETPSC As Long = 13
Const SE_SIDM_ALDEBARAN_15TAU As Long = 14
Const SE_SIDM_HIPPARCHOS As Long = 15
Const SE_SIDM_SASSANIAN As Long = 16
Const SE_SIDM_GALCENT_0SAG As Long = 17
Const SE_SIDM_J2000 As Long = 18
Const SE_SIDM_J1900 As Long = 19
Const SE_SIDM_B1950 As Long = 20
Const SE_SIDM_USER As Long = 255
Const SE_NSIDM_PREDEF As Long = 21
Const SE_SIDBITS As Long = 256
'for projection onto ecliptic of t0
Const SE_SIDBIT_ECL_T0 As Long = 256
'for projection onto solar system plane
Const SE_SIDBIT_SSY_PLANE As Long = 512
' modes for planetary nodes/apsides, swe_nod_aps(), swe_nod_aps_ut()
Const SE_NODBIT_MEAN As Long = 1
Const SE_NODBIT_OSCU As Long = 2
Const SE_NODBIT_OSCU_BAR As Long = 3
Const SE_NODBIT_FOPOINT As Long = 256
' indices for swe_rise_trans()
Const SE_CALC_RISE As Long = 1
Const SE_CALC_SET As Long = 2
Const SE_CALC_MTRANSIT As Long = 4
Const SE_CALC_ITRANSIT As Long = 8
Const SE_BIT_DISC_CENTER As Long = 256 '/* to be added to SE_CALC_RISE/SET */
'/* if rise or set of disc center is */
'/* requried */
Const SE_BIT_NO_REFRACTION As Long = 512 '/* to be added to SE_CALC_RISE/SET, */
'/* if refraction is not to be considered */
' bits for data conversion with swe_azalt() and swe_azalt_rev()
Const SE_ECL2HOR As Long = 0
Const SE_EQU2HOR As Long = 1
Const SE_HOR2ECL As Long = 0
Const SE_HOR2EQU As Long = 1
' for swe_refrac()
Const SE_TRUE_TO_APP As Long = 0
Const SE_APP_TO_TRUE As Long = 1
Public Function risesetplanet( _
lat As Double, _
Lon As Double, _
B As Double, _
riseset As Long, _
planet As Long) _
As Double
Dim Jul_day_UT As Double, tret(10) As Double
Dim ret_flag As Double, geopos(3) As Double, serr As String
geopos(0) = Lon
geopos(1) = lat
geopos(2) = 0
Jul_day_UT = B + 2415017.5
ret_flag = swe_rise_trans(Jul_day_UT, planet, "", 2, riseset, geopos(0), 1013.25, 10, tret(0), serr)
h = tret(0) - 2415018.5
risesetplanet = h
End Function
Public Function planet( _
DateTime As Double, _
PlanetID As Long) _
As Double
Dim X(6) As Double
Dim Jul_day_UT As Double
Dim i As Long, serr As String
Jul_day_UT = DateTime + 2415018.5
i = swe_set_sid_mode(SE_SIDM_LAHIRI, 0, 0)
i = swe_calc_ut(Jul_day_UT, PlanetID, SEFLG_SIDEREAL, X(0), serr)
planet = X(0)
End Function
Public Function Asdt( _
Latitude As Double, _
Longitude As Double, _
DateTime As Double) _
As Double
Dim Jul_day_UT As Double, X(13) As Double, A(10) As Double
Dim i As Long
Jul_day_UT = DateTime + 2415018.5
i = swe_houses_ex(Jul_day_UT, 65536, Latitude, Longitude, Asc("A"), X(0), A(0))
Asdt = A(0)
End Function
Public Function Naks( _
PlanetLongitude As Double) _
As String
Dim A(27) As String
A(0) = "Aswini"