Beruflich Dokumente
Kultur Dokumente
Option Explicit
'
'
'
'
SwissEphemeris - 2
) As Long
SwissEphemeris - 3
Public Declare Sub swe_cs2timestr Lib "swedll32.dll" _
Alias "_swe_cs2timestr@16" ( _
ByVal t As Long, _
ByVal sep As Long, _
ByVal supzero As Long, _
ByVal s As String _
)
Public Declare Function swe_cs2timestr_d Lib "swedll32.dll" _
Alias "_swe_cs2timestr_d@16" ( _
ByVal t As Long, _
ByVal sep As Long, _
ByVal supzero As Long, _
ByVal s As String _
) As Long
Public Declare Function swe_csnorm Lib "swedll32.dll" _
Alias "_swe_csnorm@4" ( _
ByVal p As Long _
) As Long
Public Declare Function swe_csnorm_d Lib "swedll32.dll" _
Alias "_swe_csnorm_d@4" ( _
ByVal p As Long _
) As Long
Public Declare Function swe_csroundsec Lib "swedll32.dll" _
Alias "_swe_csroundsec@4" ( _
ByVal p As Long _
) As Long
Public Declare Function swe_csroundsec_d Lib "swedll32.dll" _
Alias "_swe_csroundsec_d@4" ( _
ByVal p As Long _
) As Long
Public Declare Function swe_d2l Lib "swedll32.dll" _
Alias "_swe_d2l@8" ( _
) As Long
Public Declare Function swe_d2l_d Lib "swedll32.dll" _
Alias "_swe_d2l_d@4" ( _
) As Long
Public Declare Function swe_date_conversion Lib "swedll32.dll" _
Alias "_swe_date_conversion@28" ( _
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
Public Declare Function swe_date_conversion_d Lib "swedll32.dll" _
Alias "_swe_date_conversion_d@24" ( _
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
Public Declare Function swe_day_of_week Lib "swedll32.dll" _
Alias "_swe_day_of_week@8" ( _
ByVal jd As Double _
) As Long
SwissEphemeris - 4
Public Declare Function swe_day_of_week_d Lib "swedll32.dll" _
Alias "_swe_day_of_week_d@4" ( _
ByRef jd As Double _
) As Long
Public Declare Function swe_degnorm Lib "swedll32.dll" _
Alias "_swe_degnorm@8" ( _
ByVal jd As Double _
) As Double
Public Declare Function swe_degnorm_d Lib "swedll32.dll" _
Alias "_swe_degnorm_d@4" ( _
ByRef jd As Double _
) As Long
Public Declare Function swe_deltat Lib "swedll32.dll" _
Alias "_swe_deltat@8" ( _
ByVal jd As Double _
) As Double
Public Declare Function swe_deltat_d Lib "swedll32.dll" _
Alias "_swe_deltat_d@8" ( _
ByRef jd As Double, _
ByRef deltat As Double _
) As Long
Public Declare Function swe_difcs2n Lib "swedll32.dll" _
Alias "_swe_difcs2n@8" ( _
ByVal p1 As Long, _
ByVal p2 As Long _
) As Long
Public Declare Function swe_difcs2n_d Lib "swedll32.dll" _
Alias "_swe_difcs2n_d@8" ( _
ByVal p1 As Long, _
ByVal p2 As Long _
) As Long
Public Declare Function swe_difcsn Lib "swedll32.dll" _
Alias "_swe_difcsn@8" ( _
ByVal p1 As Long, _
ByVal p2 As Long _
) As Long
Public Declare Function swe_difcsn_d Lib "swedll32.dll" _
Alias "_swe_difcsn_d@8" ( _
ByVal p1 As Long, _
ByVal p2 As Long _
) As Long
Public Declare Function swe_difdeg2n Lib "swedll32.dll" _
Alias "_swe_difdeg2n@16" ( _
ByVal p1 As Double, _
ByVal p2 As Double _
) As Double
Public Declare Function swe_difdeg2n_d Lib "swedll32.dll" _
Alias "_swe_difdeg2n_d@12" ( _
ByRef p1 As Double, _
ByRef p2 As Double, _
ByRef Diff As Double _
) As Long
Public Declare Function swe_difdegn Lib "swedll32.dll" _
Alias "_swe_difdegn@16" ( _
ByVal p1 As Double, _
ByVal p2 As Double _
SwissEphemeris - 5
) As Long
Public Declare Function swe_difdegn_d Lib "swedll32.dll" _
Alias "_swe_difdegn_d@12" ( _
ByRef p1 As Double, _
ByRef p2 As Double, _
ByRef Diff As Double _
) As Long
Public Declare Function swe_fixstar
Alias "_swe_fixstar@24" ( _
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
' serr must
' star must
Lib "swedll32.dll" _
SwissEphemeris - 6
Public Declare Function swe_get_ayanamsa_ut_d Lib "swedll32.dll" _
Alias "_swe_get_ayanamsa_ut_d@8" ( _
ByRef tjd_ut As Double, _
ByRef ayan As Double _
) As Long
Public Declare Sub swe_get_planet_name Lib "swedll32.dll" _
Alias "_swe_get_planet_name@8" ( _
ByVal ipl As Long, _
ByVal pname As String _
)
Public Declare Function swe_get_planet_name_d Lib "swedll32.dll" _
Alias "_swe_get_planet_name_d@8" ( _
ByVal ipl As Long, _
ByVal pname As String _
) As Long
Public Declare Function swe_get_tid_acc Lib "swedll32.dll" _
Alias "_swe_get_tid_acc@0" ( _
) As Double
Public Declare Function swe_get_tid_acc_d Lib "swedll32.dll" _
Alias "_swe_get_tid_acc_d@4" ( _
ByRef x As Double _
) As Long
Public Declare Function swe_houses Lib "swedll32.dll" _
Alias "_swe_houses@36" ( _
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
Public Declare Function swe_houses_d Lib "swedll32.dll" _
Alias "_swe_houses_d@24" ( _
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
Public Declare Function swe_houses_ex Lib "swedll32.dll" _
Alias "_swe_houses_ex@40" ( _
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
Public Declare Function swe_houses_ex_d Lib "swedll32.dll" _
Alias "_swe_houses_ex_d@28" ( _
ByRef tjd_ut As Double, _
ByVal iflag As Long, _
ByRef geolat As Double, _
ByRef geolon As Double, _
SwissEphemeris - 7
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
Public Declare Function swe_houses_armc Lib "swedll32.dll" _
Alias "_swe_houses_armc@36" ( _
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
Public Declare Function swe_houses_armc_d Lib "swedll32.dll" _
Alias "_swe_houses_armc_d@24" ( _
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
Public Declare Function swe_house_pos Lib "swedll32.dll" _
Alias "_swe_house_pos@36" ( _
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
Public Declare Function swe_house_pos_d Lib "swedll32.dll" _
Alias "_swe_house_pos_d@28" ( _
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
Public Declare Function swe_julday Lib "swedll32.dll" _
Alias "_swe_julday@24" ( _
ByVal year As Long, _
ByVal month As Long, _
ByVal day As Long, _
ByVal hour As Double, _
ByVal gregflg As Long _
) As Double
Public Declare Function swe_julday_d Lib "swedll32.dll" _
Alias "_swe_julday_d@24" ( _
ByVal year As Long, _
ByVal month As Long, _
ByVal day As Long, _
ByRef hour As Double, _
ByVal gregflg As Long, _
SwissEphemeris - 8
ByRef tjd As Double _
) As Long
Public Declare Function swe_lun_eclipse_how Lib "swedll32.dll" _
Alias "_swe_lun_eclipse_how@24" ( _
ByVal tjd_ut As Double, _
ByVal ifl As Long, _
ByRef geopos As Double, _
ByRef attr As Double, _
ByVal serr As String _
) As Long
Public Declare Function swe_lun_eclipse_how_d Lib "swedll32.dll" _
Alias "_swe_lun_eclipse_how_d@20" ( _
ByRef tjd_ut As Double, _
ByVal ifl As Long, _
ByRef geopos As Double, _
ByRef attr As Double, _
ByVal serr As String _
) As Long
Public Declare Function swe_lun_eclipse_when Lib "swedll32.dll" _
Alias "_swe_lun_eclipse_when@28" ( _
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
Public Declare Function swe_lun_eclipse_when_d Lib "swedll32.dll" _
Alias "_swe_lun_eclipse_when_d@24" ( _
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
Public Declare Function swe_nod_aps Lib "swedll32.dll" _
Alias "_swe_nod_aps@40" ( _
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
Public Declare Function swe_nod_aps_ut Lib "swedll32.dll" _
Alias "_swe_nod_aps_ut@40" ( _
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
Public Declare Function swe_pheno Lib "swedll32.dll" _
Alias "_swe_pheno@24" ( _
ByVal tjd As Double, _
ByVal ipl As Long, _
ByVal iflag As Long, _
ByRef attr As Double, _
ByVal serr As String _
) As Long
SwissEphemeris - 9
Public Declare Function swe_pheno_ut Lib "swedll32.dll" _
Alias "_swe_pheno_ut@24" ( _
ByVal tjd As Double, _
ByVal ipl As Long, _
ByVal iflag As Long, _
ByRef attr As Double, _
ByVal serr As String _
) As Long
Public Declare Function swe_pheno_d Lib "swedll32.dll" _
Alias "_swe_pheno_d@20" ( _
ByRef tjd As Double, _
ByVal ipl As Long, _
ByVal iflag As Long, _
ByRef attr As Double, _
ByVal serr As String _
) As Long
Public Declare Function swe_pheno_ut_d Lib "swedll32.dll" _
Alias "_swe_pheno_ut_d@20" ( _
ByRef tjd As Double, _
ByVal ipl As Long, _
ByVal iflag As Long, _
ByRef attr As Double, _
ByVal serr As String _
) As Long
Public Declare Function swe_refrac Lib "swedll32.dll" _
Alias "_swe_refrac@28" ( _
ByVal inalt As Double, _
ByVal atpress As Double, _
ByVal attemp As Double, _
ByVal calc_flag As Long _
) As Double
Public Declare Sub swe_revjul Lib "swedll32.dll" _
Alias "_swe_revjul@28" ( _
ByVal tjd As Double, _
ByVal gregflg As Long, _
ByRef year As Long, _
ByRef month As Long, _
ByRef day As Long, _
ByRef hour As Double _
)
Public Declare Function swe_revjul_d Lib "swedll32.dll" _
Alias "_swe_revjul_d@24" ( _
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
Public Declare Function swe_rise_trans Lib "swedll32.dll" _
Alias "_swe_rise_trans@52" ( _
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
Public Declare Sub swe_set_ephe_path Lib "swedll32.dll" _
Alias "_swe_set_ephe_path@4" ( _
ByVal path As String _
)
SwissEphemeris - 10
Public Declare Function swe_set_ephe_path_d Lib "swedll32.dll" _
Alias "_swe_set_ephe_path_d@4" ( _
ByVal path As String _
) As Long
Public Declare Sub swe_set_jpl_file Lib "swedll32.dll" _
Alias "_swe_set_jpl_file@4" ( _
ByVal file As String _
)
Public Declare Function swe_set_jpl_file_d Lib "swedll32.dll" _
Alias "_swe_set_jpl_file_d@4" ( _
ByVal file As String _
) As Long
Public Declare Function swe_set_sid_mode Lib "swedll32.dll" _
Alias "_swe_set_sid_mode@20" ( _
ByVal sid_mode As Long, _
ByVal t0 As Double, _
ByVal ayan_t0 As Double _
) As Long
Public Declare Function swe_set_sid_mode_d Lib "swedll32.dll" _
Alias "_swe_sid_mode_d@12" ( _
ByVal sid_mode As Long, _
ByRef t0 As Double, _
ByRef ayan_t0 As Double _
) As Long
Public Declare Function swe_set_topo Lib "swedll32.dll" _
Alias "_swe_set_topo@24" ( _
ByVal geolon As Double, _
ByVal geolat As Double, _
ByVal altitude As Double _
)
Public Declare Function swe_set_topo_d Lib "swedll32.dll" _
Alias "_swe_set_topo_d@12" ( _
ByRef geolon As Double, _
ByRef geolat As Double, _
ByRef altitude As Double _
)
Public Declare Sub swe_set_tid_acc Lib "swedll32.dll" _
Alias "_swe_set_tid_acc@8" ( _
ByVal x As Double _
)
Public Declare Function swe_set_tid_acc_d Lib "swedll32.dll" _
Alias "_swe_set_tid_acc_d@4" ( _
ByRef x As Double _
) As Long
Public Declare Function swe_sidtime0 Lib "swedll32.dll" _
Alias "_swe_sidtime0@24" ( _
ByVal tjd_ut As Double, _
ByVal ecl As Double, _
ByVal nut As Double _
) As Double
Public Declare Function swe_sidtime0_d Lib "swedll32.dll" _
Alias "_swe_sidtime0_d@16" ( _
ByRef tjd_ut As Double, _
ByRef ecl As Double, _
ByRef nut As Double, _
ByRef sidt As Double _
) As Long
SwissEphemeris - 11
Public Declare Function swe_sidtime Lib "swedll32.dll" _
Alias "_swe_sidtime@8" ( _
ByVal tjd_ut As Double _
) As Double
Public Declare Function swe_sidtime_d Lib "swedll32.dll" _
Alias "_swe_sidtime_d@8" ( _
ByRef tjd_ut As Double, _
ByRef sidt As Double _
) As Long
Public Declare Function swe_sol_eclipse_how Lib "swedll32.dll" _
Alias "_swe_sol_eclipse_how@24" ( _
ByVal tjd_ut As Double, _
ByVal ifl As Long, _
ByRef geopos As Double, _
ByRef attr As Double, _
ByVal serr As String _
) As Long
Public Declare Function swe_sol_eclipse_how_d Lib "swedll32.dll" _
Alias "_swe_sol_eclipse_how_d@20" ( _
ByRef tjd_ut As Double, _
ByVal ifl As Long, _
ByRef geopos As Double, _
ByRef attr As Double, _
ByVal serr As String _
) As Long
Public Declare Function swe_sol_eclipse_when_glob Lib "swedll32.dll" _
Alias "_swe_sol_eclipse_when_glob@28" ( _
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
Public Declare Function swe_sol_eclipse_when_glob_d Lib "swedll32.dll" _
Alias "_swe_sol_eclipse_when_glob_d@24" ( _
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
Public Declare Function swe_sol_eclipse_when_loc Lib "swedll32.dll" _
Alias "_swe_sol_eclipse_when_loc@32" ( _
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
Public Declare Function swe_sol_eclipse_when_loc_d Lib "swedll32.dll" _
Alias "_swe_sol_eclipse_when_loc_d@28" ( _
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 _
SwissEphemeris - 12
) As Long
Public Declare Function swe_sol_eclipse_where Lib "swedll32.dll" _
Alias "_swe_sol_eclipse_where@24" ( _
ByVal tjd_ut As Double, _
ByVal ifl As Long, _
ByRef geopos As Double, _
ByRef attr As Double, _
ByVal serr As String _
) As Long
Public Declare Function swe_sol_eclipse_where_d Lib "swedll32.dll" _
Alias "_swe_sol_eclipse_where_d@20" ( _
ByRef tjd_ut As Double, _
ByVal ifl As Long, _
ByRef geopos As Double, _
ByRef attr As Double, _
ByVal serr As String _
) As Long
Public Declare Function swe_time_equ Lib "swedll32.dll" _
Alias "_swe_time_equ@16" ( _
ByVal tjd_ut As Double, _
ByRef E As Double, _
ByRef serr As String _
) As Long
' values for gregflag in swe_julday() and swe_revjul()
Public Const SE_JUL_CAL As Integer = 0
Public Const SE_GREG_CAL As Integer = 1
' planet and
Public Const
Public Const
Public Const
Public Const
Public Const
Public Const
Public Const
Public Const
Public Const
Public Const
Public Const
Public Const
Public Const
Public Const
Public Const
Public Const
Public Const
Public Const
Public Const
Public Const
Public Const
SwissEphemeris - 13
Public Const SE_VULKANUS As Integer = 46
Public Const SE_POSEIDON As Integer = 47
' other ficticious bodies
Public Const SE_ISIS As Integer = 48
Public Const SE_NIBIRU As Integer = 49
Public Const SE_HARRINGTON As Integer = 50
Public Const SE_NEPTUNE_LEVERRIER As Integer = 51
Public Const SE_NEPTUNE_ADAMS As Integer = 52
Public Const SE_PLUTO_LOWELL As Integer = 53
Public Const SE_PLUTO_PICKERING As Integer = 54
' points returned by swe_houses() and swe_houses_armc()
' in array ascmc(0...10)
Public Const SE_ASC
As Integer = 0
Public Const SE_MC
As Integer = 1
Public Const SE_ARMC
As Integer = 2
Public Const SE_VERTEX
As Integer = 3
Public Const SE_EQUASC
As Integer = 4 ' "equatorial ascendant"
Public Const SE_NASCMC
As Integer = 5 ' number of such points
' iflag values for swe_calc()/swe_calc_ut() and
' swe_fixstar()/swe_fixstar_ut()
Public Const SEFLG_JPLEPH As Long = 1
Public Const SEFLG_SWIEPH As Long = 2
Public Const SEFLG_MOSEPH As Long = 4
Public Const SEFLG_SPEED As Long = 256
Public Const SEFLG_HELCTR As Long = 8
Public Const SEFLG_TRUEPOS As Long = 16
Public Const SEFLG_J2000 As Long = 32
Public Const SEFLG_NONUT As Long = 64
Public Const SEFLG_NOGDEFL As Long = 512
Public Const SEFLG_NOABERR As Long = 1024
Public Const SEFLG_EQUATORIAL As Long = 2048
Public Const SEFLG_XYZ As Long = 4096
Public Const SEFLG_RADIANS As Long = 8192
Public Const SEFLG_BARYCTR As Long = 16384
Public Const SEFLG_TOPOCTR As Long = 32768
Public Const SEFLG_SIDEREAL As Long = 65536
'eclipse codes
Public Const SE_ECL_CENTRAL As Long = 1
Public Const SE_ECL_NONCENTRAL As Long = 2
Public Const SE_ECL_TOTAL As Long = 4
Public Const SE_ECL_ANNULAR As Long = 8
Public Const SE_ECL_PARTIAL As Long = 16
Public Const SE_ECL_ANNULAR_TOTAL As Long = 32
Public Const SE_ECL_PENUMBRAL As Long = 64
Public Const SE_ECL_VISIBLE As Long = 128
Public Const SE_ECL_MAX_VISIBLE As Long = 256
Public Const SE_ECL_1ST_VISIBLE As Long = 512
Public Const SE_ECL_2ND_VISIBLE As Long = 1024
Public Const SE_ECL_3RD_VISIBLE As Long = 2048
Public Const SE_ECL_4TH_VISIBLE As Long = 4096
'sidereal modes, for swe_set_sid_mode()
Public Const SE_SIDM_FAGAN_BRADLEY
As Long = 0
Public Const SE_SIDM_LAHIRI
As Long = 1
Public Const SE_SIDM_DELUCE
As Long = 2
Public Const SE_SIDM_RAMAN
As Long = 3
Public Const SE_SIDM_USHASHASHI
As Long = 4
Public Const SE_SIDM_KRISHNAMURTI
As Long = 5
Public Const SE_SIDM_DJWHAL_KHUL
As Long = 6
Public Const SE_SIDM_YUKTESHWAR
As Long = 7
Public Const SE_SIDM_JN_BHASIN
As Long = 8
Public Const SE_SIDM_BABYL_KUGLER1
As Long = 9
Public Const SE_SIDM_BABYL_KUGLER2
As Long = 10
Public Const SE_SIDM_BABYL_KUGLER3
As Long = 11
Public Const SE_SIDM_BABYL_HUBER
As Long = 12
SwissEphemeris - 14
Public
Public
Public
Public
Public
Public
Public
Public
Public
Const
Const
Const
Const
Const
Const
Const
Const
Const
SE_SIDM_BABYL_ETPSC
SE_SIDM_ALDEBARAN_15TAU
SE_SIDM_HIPPARCHOS
SE_SIDM_SASSANIAN
SE_SIDM_GALCENT_0SAG
SE_SIDM_J2000
SE_SIDM_J1900
SE_SIDM_B1950
SE_SIDM_USER
As
As
As
As
As
As
As
As
As
Long
Long
Long
Long
Long
Long
Long
Long
Long
=
=
=
=
=
=
=
=
=
13
14
15
16
17
18
19
20
255
As Long = 21
As Long = 0
As Long = 1
SwissEphemeris - 15
If mins < 10 Then
DegMin = DegMin & " " & mins
Else
DegMin = DegMin & "" & mins
End If
DegMin = DegMin & "'" & suffix
End Function
Public Function Dms(x As Double) As String
Dim y As Double, l As Double, degs As Integer, _
mins As Integer, secs As Integer, _
suffix As String
y = (x / 360 - Int(x / 360)) * 360
suffix = Mid(sknam, 1 + 2 * Int(y / 30), 2)
y = y - 30 * Int(y / 30)
l = y
degs = Int(y)
If degs < 10 Then
Dms = " " & degs
Else
Dms = degs
End If
y = (y - degs) * 60
mins = Int(y)
If mins < 10 Then
Dms = Dms & " " & mins
Else
Dms = Dms & "" & mins
End If
y = (y - mins) * 60
If y > 59 And l > 29.983333 Then
secs = 59
Else
secs = Int(y + 0.5)
End If
If secs < 10 Then
Dms = Dms & "' " & secs
Else
Dms = Dms & "'" & secs
End If
Dms = Dms & """ " & suffix
End Function
Public Function Dms360(x As Double) As String
Dim y As Double, degs As Integer, _
mins As Integer, secs As Integer
y = x + 0.5 / 3600
y = (y / 360 - Int(y / 360)) * 360
degs = Int(y)
If degs >= 100 Then
Dms360 = degs
Else
If degs >= 10 Then
Dms360 = " " & degs
Else
Dms360 = " " & degs
End If
End If
y = (y - degs) * 60
mins = Int(y)
SwissEphemeris - 16
If mins < 10 Then
Dms360 = Dms360 &
Else
Dms360 = Dms360 &
End If
y = (y - mins) * 60
secs = Int(y)
If secs < 10 Then
Dms360 = Dms360 &
Else
Dms360 = Dms360 &
End If
SwissEphemeris - 17
' Reset the length of a zero-terminated string
' Necessary for communication with Swiss Ephemeris
Public Function trim0(c$) As String
Dim i As Integer
i = InStr(c$, Chr$(0))
If i > 0 Then
trim0 = Left(c$, i - 1)
End If
End Function
Public Function JulianDayNumber(dateString As String, time As Double)
Dim x As Variant, gregflag As Long
x = Split(dateString, ".")
If UBound(x) <> 2 Then
JulianDayNumber = 0
Exit Function
End If
If Right$(x(2), 1) = "j" Then
gregflag = SE_JUL_CAL
x(2) = Left$(x(2), Len(x(2)) - 1)
Else
If Right$(x(2), 1) = "g" Then
gregflag = SE_GREG_CAL
x(2) = Left$(x(2), Len(x(2)) - 1)
Else
' Default rule for determination of calendar flag:
' Take Julian calendar before 15.10.1582
If x(2) < 1582 Or ( _
x(2) = 1582 And ( _
x(1) < 10 Or _
x(1) = 10 And x(0) < 15) _
) _
Then
gregflag = SE_JUL_CAL
Else
gregflag = SE_GREG_CAL
End If
End If
End If
JulianDayNumber = swe_julday(x(2), x(1), x(0), time, gregflag)
End Function
Public Function calendarDate(jd As Double, Optional iCalFlag As Long = -1) As String
Dim day As Long, month As Long, year As Long
Dim hour As Double
Dim calflag
If iCalFlag > -1 Then
calflag = iCalFlag
Else
If jd < 2299171 Then
calflag = SE_JUL_CAL
Else
calflag = SE_GREG_CAL
End If
End If
Call swe_revjul(jd, calflag, year, month, day, hour)
calendarDate = day & "." & month & "." & year
SwissEphemeris - 18
End Function
' Compute Julian Day Number in Ephemeris Time from calendar date in UT
Public Function jd_from_date_ut(caldate As String, ut As String) As Double
Dim x As Variant
Dim t As Double
If caldate = "" Then
jd_from_date_ut = 0
Exit Function
End If
t = time_to_double(ut)
' Compute Day number from date string and time as double
jd_from_date_ut = JulianDayNumber(caldate, t)
If jd_from_date_ut <> 0 Then
' Correct with Delta T
jd_from_date_ut = jd_from_date_ut + swe_deltat(jd_from_date_ut)
End If
End Function
' Parse a time string with hours, minutes and seconds into a double number representing the hour
s
Public Function time_to_double(time As String) As Double
Dim y As Variant, z As Variant, z1 As Variant
Dim h As Long, m As Long, s As Long
If time = "" Then
time_to_double = 0
Exit Function
End If
y = Split(time, "h")
h = y(0)
If y(1) = "" Then
m = 0
s = 0
Else
z = Split(y(1), "m")
m = z(0)
If UBound(z) = 0 Then
s = 0
ElseIf z(1) = "" Then
s = 0
Else
z1 = Split(z(1), "s")
s = z1(0)
End If
End If
time_to_double = h + m / 60 + s / 3600
End Function
Function time_from_jd(jd As Double) As String
time_from_jd = Hms((jd + 0.5 - Int(jd + 0.5)) * 24)
End Function
Function ut_from_jd(jd_et As Double) As String
ut_from_jd = time_from_jd(jd_et - swe_deltat(jd_et))
End Function