# Calculate gravity at sea level in different locations
gravity_equator <- astro_observer_gravity(latitude = 0, height = 0)
gravity_pole <- astro_observer_gravity(latitude = 90, height = 0)
gravity_sydney <- astro_observer_gravity(latitude = -33.8688, height = 0)
# Gravity is stronger at the poles
cat(sprintf("Equator: %.6f m/s²\n", gravity_equator))
cat(sprintf("Pole: %.6f m/s²\n", gravity_pole))
cat(sprintf("Sydney: %.6f m/s²\n", gravity_sydney))
Run the code above in your browser using DataLab