Learn R Programming

astronomyengine (version 0.1.0)

astro_next_transit: Search for the next transit of Mercury or Venus

Description

Finds the next transit of Mercury or Venus after a previous transit. Call this repeatedly to find successive transits.

Usage

astro_next_transit(body, prev_transit_time)

Value

A list with elements:

start

Start time of the transit (POSIXct).

peak

Time of closest approach (POSIXct).

finish

End time of the transit (POSIXct).

separation

Angular separation at peak in arcminutes.

Arguments

body

Integer code for the planet. Use 1 for Mercury or 2 for Venus.

prev_transit_time

A POSIXct datetime from a previous transit result.

Examples

Run this code
start <- as.POSIXct("2025-01-01", tz = "UTC")
transit1 <- astro_search_transit(astro_body["MERCURY"], start)
transit2 <- astro_next_transit(astro_body["MERCURY"], transit1$peak)

Run the code above in your browser using DataLab