R/calculate_height.R

Defines functions calculate_height

Documented in calculate_height

################################################################################
#
#' Calculate height (distance from north to south) of S3M grid given a value of
#' \code{d}
#'
#' @param d A numeric value for length (in kilometres) of the maximum distance
#'     of a village/community from a sampling point. This can be the output of
#'     the function \code{calculate_d()}
#'
#' @return A numeric value in kilometres of height (distance from north to
#'     south) of the S3M grid
#'
#' @examples
#'
#' # Calculate height given a d of 6 kms
#' calculate_height(d = 6)
#'
#' @author Ernest Guevarra based on equations by Mark Myatt
#'
#' @export
#'
#
################################################################################

calculate_height <- function(d) {
  height <- (sqrt(3) / 2) * d
  return(height)
}
SpatialWorks/spatialsampler documentation built on Oct. 16, 2021, 8:05 p.m.