Skip to contents

Dates and times

Functions for creating and manipulating time values for astronomy calculations.

astro_current_time()
Current UTC time according to Astronomy Engine
astro_make_time()
Create an astronomical time value

Celestial bodies

Functions for working with celestial body identifiers.

astro_body
Celestial body codes
astro_body_code()
Get the integer code for a celestial body by name
astro_body_name()
Get the name of a celestial body

Position of Sun, Moon, and planets

Calculate positions of celestial bodies as seen from Earth or the Sun.

astro_helio_vector()
Heliocentric position vector of a celestial body
astro_geo_vector()
Geocentric position vector of a celestial body
astro_equator()
Topocentric equatorial coordinates of a celestial body
astro_ecliptic()
Convert J2000 equatorial coordinates to ecliptic coordinates
astro_ecliptic_longitude()
Heliocentric ecliptic longitude of a body
astro_horizon()
Horizontal coordinates of a celestial body
astro_pair_longitude()
Ecliptic longitude of one body relative to another
astro_bary_state()
Barycentric position and velocity vectors

Geographic helper functions

Functions for working with observer locations on Earth.

astro_observer_vector()
Observer position vector from geographic coordinates
astro_vector_observer()
Geographic coordinates from observer position vector

Rise, set, and culmination times

Find times when celestial bodies rise, set, or reach specific altitudes.

astro_search_rise_set()
Search for the next rise or set time of a celestial body
astro_search_altitude()
Search for when a body reaches a specified altitude
astro_search_hour_angle()
Search for when a body reaches a specified hour angle
astro_hour_angle()
Calculate the hour angle of a body

Moon phases

Calculate and search for specific Moon phases.

astro_moon_phase()
Moon Phase Angle
astro_search_moon_phase()
Search for a Specific Moon Phase
astro_search_moon_quarter()
Find First Lunar Quarter
astro_next_moon_quarter()
Find Next Lunar Quarter

Eclipses and Transits

Search for lunar eclipses, solar eclipses, and planetary transits.

astro_search_lunar_eclipse()
Search for a lunar eclipse
astro_next_lunar_eclipse()
Find the next lunar eclipse in a series
search_global_solar_eclipse()
Search for a global solar eclipse
next_global_solar_eclipse()
Search for the next global solar eclipse
search_local_solar_eclipse()
Search for a local solar eclipse
next_local_solar_eclipse()
Search for the next local solar eclipse
astro_search_transit()
Search for a transit of Mercury or Venus
astro_next_transit()
Search for the next transit of Mercury or Venus

Lunar perigee and apogee

Find times of the Moon’s closest and farthest points from Earth.

search_lunar_apsis()
Search for lunar apsis events
next_lunar_apsis()
Find the next lunar apsis event

Planetary aphelion and perihelion

Find times of planets’ closest and farthest points from the Sun.

search_planet_apsis()
Search for the next planetary apsis
next_planet_apsis()
Find the next planetary apsis in a series

Visual magnitude and elongation

Calculate brightness and angular separation of celestial bodies.

astro_illumination()
Illumination data for a celestial body
astro_search_peak_magnitude()
Search for peak magnitude of Venus
astro_angle_from_sun()
Angle from the Sun
astro_elongation()
Elongation of a celestial body
astro_search_max_elongation()
Search for maximum elongation

Oppositions and conjunctions

Find when planets reach specific relative positions.

astro_search_relative_longitude()
Search for relative longitude event between Earth and another planet

Equinoxes, solstices, and apparent solar motion

Find equinoxes, solstices, and track the Sun’s position.

astro_search_sun_longitude()
Search for Sun longitude
astro_seasons()
Equinoxes and Solstices for a Given Year
astro_sun_position()
Sun's position in ecliptic coordinates

Coordinate transforms

Convert between different astronomical coordinate systems and representations.

astro_rotate_vector()
Apply a rotation to a vector
astro_inverse_rotation()
Calculate the inverse of a rotation matrix
astro_combine_rotation()
Combine two rotation matrices
astro_identity_matrix()
Create an identity rotation matrix
astro_pivot()
Re-orient a rotation matrix by pivoting around an axis
astro_vector_from_sphere()
Convert Spherical Coordinates to Cartesian Vector
astro_sphere_from_vector()
Convert Cartesian Vector to Spherical Coordinates
astro_equator_from_vector()
Convert Cartesian Vector to Equatorial Coordinates
astro_vector_from_horizon()
Convert Horizontal Coordinates to Cartesian Vector
astro_horizon_from_vector()
Convert Cartesian Vector to Horizontal Coordinates
astro_rotation_EQD_EQJ()
Rotation Matrix from EQD to EQJ
astro_rotation_EQD_ECT()
Rotation Matrix from EQD to ECT
astro_rotation_EQD_ECL()
Rotation Matrix from Equatorial of-Date to J2000 Ecliptic
astro_rotation_EQD_HOR()
Rotation Matrix from EQD to HOR
astro_rotation_EQJ_EQD()
Rotation Matrix from EQJ to EQD
astro_rotation_EQJ_ECT()
Rotation Matrix from EQJ to ECT
astro_rotation_EQJ_ECL()
Rotation Matrix from EQJ to ECL
astro_rotation_EQJ_HOR()
Rotation Matrix from J2000 Equatorial to Horizontal
astro_rotation_ECT_EQD()
Rotation Matrix from ECT to EQD
astro_rotation_ECT_EQJ()
Rotation Matrix from ECT to EQJ
astro_rotation_ECL_EQD()
Rotation Matrix from J2000 Ecliptic to Equatorial of-Date
astro_rotation_ECL_EQJ()
Rotation Matrix from ECL to EQJ
astro_rotation_ECL_HOR()
Rotation Matrix from ECL to HOR
astro_rotation_HOR_EQD()
Rotation Matrix from HOR to EQD
astro_rotation_HOR_EQJ()
Rotation Matrix from Horizontal to J2000 Equatorial
astro_rotation_HOR_ECL()
Rotation Matrix from HOR to ECL
astro_rotation_EQJ_GAL()
Rotation Matrix from EQJ to GAL
astro_rotation_GAL_EQJ()
Rotation Matrix from GAL to EQJ

Observer state

Functions for calculating observer-related state information.

astro_observer_state()
Observer position and velocity vector from geographic coordinates
astro_observer_gravity()
Observer gravitational acceleration
astro_body
Celestial body codes