R/lunar_phase.R

Defines functions lunar_phase

Documented in lunar_phase

# ---------------------------------------------------------------------------- #
#' lunar_phase
#'
#' @description Lunar phase for a given Julian day number
#'
#' @param jd Julian day number
#'
#' @return Lunar phase
#'
#' @examples
#' lunar_phase(2459778)
lunar_phase <- function(jd){
  sl = sun_longitude(jd)
  ll = moon_longitude(jd)
  moon_phase <- ((ll-sl) %% 360)
  return (moon_phase)
}
# ---------------------------------------------------------------------------- #

Try the VedicDateTime package in your browser

Any scripts or data that you put into this service are public.

VedicDateTime documentation built on Sept. 20, 2023, 9:08 a.m.