R/ThetaFromChordLength.R

Defines functions ThetaFromChordLength

Documented in ThetaFromChordLength

#' Get theta from chord length
#'
#' Returns theta in radians from a chord length in kilometres
#' @param chord_length The chord length in kilometres.
#' @param EarthRad Radius of the Earth in kilometres.
#' @return Theta in radians.
#' @details Nothing yet.
#' @author Graeme T. Lloyd \email{graemetlloyd@@gmail.com}
#' @export
#'
#' @examples
#' ThetaFromChordLength(1000)

# Get theta in radians from chord length and radius in km:
ThetaFromChordLength <- function(chord_length, EarthRad = 6367.4447) {
	
	# Get theta in radians from chord length and radius in km:
	asin((chord_length * 0.5) / EarthRad) * 2
	
}
laurasoul/dispeRse documentation built on May 25, 2021, 4:50 a.m.