R/euclidDistance.R

Defines functions euclidDistance

Documented in euclidDistance

#' @title Euclidean distance between two points
#'
#' @param x1 x-coordinate of point 1
#' @param y1 y-coordinate of point 1
#' @param x2 x-coordinate of point 2
#' @param y2 y-coordinate of point 2
#'
#' @return The Euclidean distance between points 1 and 2 as a number
#' @export
euclidDistance <- function(x1, y1, x2, y2){
  sqrt((x1-x2)^2 + (y1-y2)^2)
}

Try the locationgamer package in your browser

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

locationgamer documentation built on Dec. 18, 2020, 5:08 p.m.