lunar_phase_polygon | R Documentation |
Function that calculates coordinates of a polygon representing the shape of the illuminated fraction of the moon, as observed from Earth. The shape has a radius of 1 and is centred around (0, 0). It does not consider lunar eclipses.
lunar_phase_polygon(date, longitude, latitude, n = 100)
date |
A datetime object used to calculate the illuminated fraction of the moon |
longitude , latitude |
Used to calculate zenith angle. This will result in a more accurate shape of the moon as observed at the specified location. |
n |
Number of coordinates in the returned polygon shape (should be even). |
Returns a data.frame
with coordinates of a polygon representing
the shape of the illuminated fraction of the moon.
Pepijn de Vries
disc_illum <- lunar_phase_polygon(as.POSIXct("2025-04-01"))
plot(NA, NA, xlim = c(-1,1), ylim = c(-1, 1), asp = 1,
xlab = "x coord", ylab = "y coord")
polygon(disc_illum$x, disc_illum$y, col = "white")
disc_illum <- lunar_phase_polygon(as.POSIXct("2025-04-01"), 5, 50)
plot(NA, NA, xlim = c(-1,1), ylim = c(-1, 1), asp = 1,
xlab = "x coord", ylab = "y coord")
polygon(disc_illum$x, disc_illum$y, col = "white")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.