### swe_get_library_path Source: https://github.com/aloistr/swisseph/blob/master/windows/vb/swedecl.txt Retrieves the installation path of the Swiss Ephemeris library. ```APIDOC ## swe_get_library_path ### Description Retrieves the installation path of the Swiss Ephemeris DLL. ### Method Declare Function swe_get_library_path Lib "swedll32.dll" Alias "_swe_get_library_path@4" ( ByVal svers As String ) As String ### Parameters * **svers** (String) - A string buffer to hold the library path (must be able to hold 256 bytes). ### Return Value A string containing the library path. ``` -------------------------------- ### swe_get_library_path Source: https://github.com/aloistr/swisseph/blob/master/windows/vb/swedecl64.txt Retrieves the installation path of the Swiss Ephemeris library. ```APIDOC ## swe_get_library_path ### Description Retrieves the installation path of the Swiss Ephemeris library. ### Method Private Declare PtrSafe Function swe_get_library_path Lib "swedll64.dll" ### Parameters #### Path Parameters - **svers** (String) - Output parameter that must be able to hold 256 bytes for the library path. ``` -------------------------------- ### Initialization, Setup, and Closing Functions Source: https://github.com/aloistr/swisseph/blob/master/doc/swisseph.htm Functions for setting up the ephemeris file path, JPL ephemeris file, and closing the Swiss Ephemeris library. ```APIDOC ## swe_set_ephe_path() ### Description Sets the directory path where ephemeris files are located. ### Function Signature `swe_set_ephe_path(path)` ### Parameters - **path** (string) - Directory path for ephemeris files ``` ```APIDOC ## swe_set_jpl_file() ### Description Sets the name of the JPL ephemeris file to be used for calculations. ### Function Signature `swe_set_jpl_file(filename)` ### Parameters - **filename** (string) - Name of the JPL ephemeris file ``` ```APIDOC ## swe_close() ### Description Closes the Swiss Ephemeris library, releasing any allocated resources. ### Function Signature `swe_close()` ``` -------------------------------- ### Run swetest for Jupiter Barycentre Source: https://github.com/aloistr/swisseph/blob/master/doc/swisseph.htm This example demonstrates how to use the `swetest` command-line tool to calculate ephemeris data for Jupiter Barycentre. It specifies the date, planet, flags for output format, number of lines, ephemeris file, and a specific calculation mode. ```bash swetest -b25.10.2016 -p5 -fTPADlb -n1 -ejplde431.eph -jplhora ``` -------------------------------- ### swe_house_name Source: https://github.com/aloistr/swisseph/blob/master/windows/vb/swedecl64.txt Gets the name of a house system. ```APIDOC ## swe_house_name ### Description Gets the name of a house system. ### Function Signature ```vb Private Declare PtrSafe Sub swe_house_name Lib "swedll64.dll" _ ( _ ByVal ihsy As Long _ ) ``` ### Parameters * **ihsy**: House system identifier. ``` -------------------------------- ### swetest Output Example Source: https://github.com/aloistr/swisseph/blob/master/doc/swisseph.htm This output shows the result of running the `swetest` command for a specific date and planet. It includes the date, time, ephemeris version, and the Julian Day (TT) value. ```text date (dmy) 25.10.2016 greg. 0:00:00 ET version 2.05.02b04 TT: 2457686.500000000 ``` -------------------------------- ### swe_get_tid_acc Source: https://github.com/aloistr/swisseph/blob/master/windows/vb/swedecl64.txt Gets the tidal acceleration value. ```APIDOC ## swe_get_tid_acc ### Description Gets the tidal acceleration value. ### Function Signature ```vb Private Declare PtrSafe Function swe_get_tid_acc Lib "swedll64.dll" _ ( _ ) As Double ``` ``` -------------------------------- ### swe_get_ayanamsa_name Source: https://github.com/aloistr/swisseph/blob/master/windows/vb/swedecl64.txt Gets the name of the ayanamsa mode. ```APIDOC ## swe_get_ayanamsa_name ### Description Gets the name of the ayanamsa mode. ### Function Signature ```vb Private Declare PtrSafe Sub swe_get_ayanamsa_name Lib "swedll64.dll" _ ( _ ByVal isidmode As String _ ) ``` ### Parameters * **isidmode**: String representing the sidereal mode. ``` -------------------------------- ### swe_get_planet_name Source: https://github.com/aloistr/swisseph/blob/master/windows/vb/swedecl64.txt Gets the name of a planet given its identifier. ```APIDOC ## swe_get_planet_name ### Description Gets the name of a planet given its identifier. ### Function Signature ```vb Private Declare PtrSafe Sub swe_get_planet_name Lib "swedll64.dll" _ ( _ ByVal ipl As Long, _ ByVal pname As String _ ) ``` ### Parameters * **ipl**: Planet identifier. * **pname**: Output string for the planet name. ``` -------------------------------- ### Compare Placidus House Calculation (SE 2.08 vs SE 2.09) Source: https://github.com/aloistr/swisseph/blob/master/doc/swisseph.htm Compares the command-line usage for calculating Placidus houses with older (SE 2.08) and newer (SE 2.09) versions of the Swiss Ephemeris library. Demonstrates the input parameters for specifying date, time, and house system. ```bash sweph2.08/swetest -b26.1.2000 -ut8:08 -house30,66.562,P -p ``` ```bash swetest -b26.1.2000 -ut8:08 -house30,66.562,P -p ``` -------------------------------- ### Calculate Astrometric Positions with swetest Source: https://github.com/aloistr/swisseph/blob/master/doc/swisseph.htm Demonstrates how to use the `swetest` command-line tool to calculate astrometric positions for a celestial body. Specify date, planet, coordinate system, output format, number of days, ephemeris file, and options like no aberration or deflection. ```bash swetest -b25.10.2016 -p4 -j2000 -icrs -fTPAD -n3 -ejplde431.eph -noaberr -nodefl ``` -------------------------------- ### Find Global Solar Eclipse Times (VB.NET) Source: https://github.com/aloistr/swisseph/blob/master/windows/vb/swedecl64.txt Finds the times of global solar eclipses starting from a given Julian day. Allows searching forwards or backwards. Requires start time, flags, type, return time, direction, and an error string buffer. ```vbnet 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 ' serr must be able to hold 256 bytes ``` -------------------------------- ### Find Global Lunar Occultation Times (VB.NET) Source: https://github.com/aloistr/swisseph/blob/master/windows/vb/swedecl64.txt Finds the times of global lunar occultations starting from a given Julian day. Allows searching forwards or backwards. Requires start time, planet, star, flags, type, return time, direction, and an error string buffer. ```vbnet Private Declare PtrSafe Function swe_lun_occult_when_glob Lib "swedll64.dll" _ ( _ ByVal tjd_start As Double, _ ByVal ipl As Long, _ ByVal star As String, _ ByVal ifl As Long, _ ByVal ifltype As Long, _ ByRef tret As Double, _ ByVal backward As Long, _ ByVal serr As String _ ) As Long ' serr must be able to hold 256 bytes ``` -------------------------------- ### Set Sidereal Mode (VB.NET) Source: https://github.com/aloistr/swisseph/blob/master/windows/vb/swedecl64.txt Configures the sidereal mode for calculations. Requires sidereal mode, epoch, and sidereal epoch values. ```vbnet 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 ``` -------------------------------- ### Convert Time to Equation of Equinoxes (VB.NET) Source: https://github.com/aloistr/swisseph/blob/master/windows/vb/swedecl64.txt Converts a Julian day to the equation of equinoxes. Requires Julian day, a variable for the result, and an error string buffer. ```vbnet Private Declare PtrSafe Function swe_time_equ Lib "swedll64.dll" _ ( _ ByVal tjd_ut As Double, _ ByRef e As Double, _ ByVal serr As String _ ) As Long ' serr must be able to hold 256 bytes ``` -------------------------------- ### Find Local Solar Eclipse Times (VB.NET) Source: https://github.com/aloistr/swisseph/blob/master/windows/vb/swedecl64.txt Finds the times of solar eclipses visible from a specific geographic location, starting from a given Julian day. Allows searching forwards or backwards. Requires start time, flags, position, return time, attributes, direction, and an error string buffer. ```vbnet Private Declare PtrSafe Function swe_sol_eclipse_when_loc Lib "swedll64.dll" _ ( _ ByVal tjd_start As Double, _ ByVal ifl As Long, _ ByRef geopos As Double, _ ByRef tret As Double, _ ByRef attr As Double, _ ByVal backward As Long, _ ByVal serr As String _ ) As Long ' serr must be able to hold 256 bytes ``` -------------------------------- ### Find Local Lunar Occultation Times (VB.NET) Source: https://github.com/aloistr/swisseph/blob/master/windows/vb/swedecl64.txt Finds the times of lunar occultations visible from a specific geographic location, starting from a given Julian day. Allows searching forwards or backwards. Requires start time, planet, star, flags, return time, attributes, direction, and an error string buffer. ```vbnet Private Declare PtrSafe Function swe_lun_occult_when_loc Lib "swedll64.dll" _ ( _ ByVal tjd_start As Double, _ ByVal ipl As Long, _ ByVal star As String, _ ByVal ifl As Long, _ ByRef tret As Double, _ ByRef attr As Double, _ ByVal backward As Long, _ ByVal serr As String _ ) As Long ' serr must be able to hold 256 bytes ``` -------------------------------- ### Set Ephemeris Path (VB.NET) Source: https://github.com/aloistr/swisseph/blob/master/windows/vb/swedecl64.txt Use this to set the path for ephemeris data files. Ensure the path string is valid. ```vbnet Private Declare PtrSafe Sub swe_set_ephe_path Lib "swedll64.dll" _ ( _ ByVal path As String _ ) ``` -------------------------------- ### Reproduce Mean Ayanamshas (2019, 12:00 TT) Source: https://github.com/aloistr/swisseph/blob/master/doc/swisseph.htm Reproduces mean ayanamsa values for 2019 assuming 12:00 TT using `swetest` with specific flags for time, precession, sidereal time, and no nutation. Compares the result with IAE 2019 values. ```bash swetest -b1.1.2019 -t12 -p -sid1 -fTL -nonut -sidbit8192 ``` -------------------------------- ### Auxiliary Functions Source: https://github.com/aloistr/swisseph/blob/master/doc/swisseph.htm Utility functions for coordinate transformations, getting planet names, and normalizing degree values. ```APIDOC ## swe_cotrans() ### Description Performs coordinate transformation between ecliptic and equatorial systems. ### Function Signature `swe_cotrans(x, y, epheflag, xout, yout)` ### Parameters - **x**, **y** (double, double) - Input coordinates - **epheflag** (int) - Flags for coordinate system and ephemeris ### Returns - `xout`, `yout` (double, double) - Output coordinates - `serr` (int) - Error code ``` ```APIDOC ## swe_cotrans_sp() ### Description Performs coordinate transformation of position and speed between ecliptic and equatorial systems. ### Function Signature `swe_cotrans_sp(x, y, dx, dy, epheflag, xout, yout, dxout, dyout)` ### Parameters - **x**, **y**, **dx**, **dy** (double, double, double, double) - Input position and speed - **epheflag** (int) - Flags for coordinate system and ephemeris ### Returns - `xout`, `yout`, `dxout`, `dyout` (double, double, double, double) - Output position and speed - `serr` (int) - Error code ``` ```APIDOC ## swe_get_planet_name() ### Description Retrieves the name of a planet given its ID. ### Function Signature `swe_get_planet_name(ipl)` ### Parameters - **ipl** (int) - Planet ID ### Returns - `planet_name` (string) - Name of the planet ``` ```APIDOC ## swe_degnorm() ### Description Normalizes any degree value to the range of 0 to 360 degrees. ### Function Signature `swe_degnorm(deg)` ### Parameters - **deg** (double) - Degree value to normalize ### Returns - `normalized_deg` (double) - Normalized degree value ``` -------------------------------- ### swe_rise_trans Source: https://github.com/aloistr/swisseph/blob/master/windows/vb/swedecl64.txt Calculates rise and set times for a celestial body. ```APIDOC ## swe_rise_trans ### Description Calculates rise and set times for a celestial body. ### Function Signature ```vb 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, _ ``` ### Parameters - **tjd_ut** (Double) - Julian day in UT. - **ipl** (Long) - Body to calculate for. - **starname** (String) - Name of the celestial body. - **epheflag** (Long) - Ephemeris flags. - **rsmi** (Long) - Rise/set/transit flag. - **geopos** (Double Array) - Geographic position. - **atpress** (Double) - Atmospheric pressure. - **attemp** (Double) - Atmospheric temperature. - **tret** (Double Array) - Julian day of the event. ``` -------------------------------- ### Get Day of the Week Source: https://github.com/aloistr/swisseph/blob/master/doc/swisseph.htm Determines the day of the week, where Monday is 0 and Sunday is 6. This function is a renamed version of the former PLACALC function day_of_week(). ```c swe_day_of_week(); ``` -------------------------------- ### Reproduce Mean Ayanamshas (1989) Source: https://github.com/aloistr/swisseph/blob/master/doc/swisseph.htm Reproduces mean ayanamsa values for 1989 using `swetest` with no nutation and specific flags for precession and sidereal time. Compares the result with IAE 1989 values. ```bash swetest -b1.1.1989 -nonut -fPZ -p -sid1 -sidbit8192 |grep ayanamsa ``` -------------------------------- ### Reproduce Mean Ayanamshas (2000, 12:00 TT) Source: https://github.com/aloistr/swisseph/blob/master/doc/swisseph.htm Reproduces mean ayanamsa values for 2000 assuming 12:00 TT using `swetest` with specific flags for time, precession, sidereal time, and no nutation. Compares the result with IAE 2019 values. ```bash swetest -b1.1.2000 -t12 -p -sid1 -fTL -nonut -sidbit8192 ``` -------------------------------- ### Get Solar Eclipse Details (VB.NET) Source: https://github.com/aloistr/swisseph/blob/master/windows/vb/swedecl64.txt Retrieves details about a solar eclipse at a specific time and location. Requires Julian day, flags, position, and an error string buffer. ```vbnet 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 ' serr must be able to hold 256 bytes ``` -------------------------------- ### Swisseph: Geocentric Equatorial Coordinates of Mars Source: https://github.com/aloistr/swisseph/blob/master/doc/swisseph.htm Use this command to get the geocentric equatorial coordinates of Mars, similar to the Astronomical Almanac. Note the difference in the distance value compared to AA. ```bash swetest -b25.10.2016 -p4 -fTPADR -ejplde431.eph ``` -------------------------------- ### swe_houses_ex2 Source: https://github.com/aloistr/swisseph/blob/master/windows/vb/swedecl64.txt Calculates house cusps and the ascendant/mc with extended options and speed information. ```APIDOC ## swe_houses_ex2 ### Description Calculates house cusps and the ascendant/mc with extended options and speed information. ### Function Signature ```vb Private Declare PtrSafe Function swe_houses_ex2 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, _ ByRef cusp_speed As Double, _ ByRef ascmc_speed As Double, _ ByVal serr as String _ ) As Long ``` ### Parameters * **tjd_ut**: Julian day in UT. * **iflag**: Flags for calculation options. * **geolat**: Geographic latitude. * **geolon**: Geographic longitude. * **ihsy**: House system identifier. * **hcusps**: Output array for house cusps (13 elements). * **ascmc**: Output array for ascendant and mc (10 elements). * **cusp_speed**: Output array for cusp speeds (13 elements). * **ascmc_speed**: Output array for ascendant/mc speeds (10 elements). * **serr**: String for error messages. ```