% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/distance.R
\name{a5_cell_distance}
\alias{a5_cell_distance}
\title{Distance between cell centroids}
\usage{
a5_cell_distance(
  from,
  to,
  units = "m",
  method = c("haversine", "geodesic", "rhumb")
)
}
\arguments{
\item{from, to}{\link{a5_cell} vectors (recycled to common length).}

\item{units}{Character scalar specifying the distance unit (default
\code{"m"}). Any unit convertible from metres via \code{\link[units:set_units]{units::set_units()}} is
accepted (e.g. \code{"km"}, \code{"mi"}). If NULL, the distance is returned as a
numeric vector in metres.}

\item{method}{Distance calculation method. One of \code{"haversine"}
(great-circle, default), \code{"geodesic"} (WGS84 ellipsoid via Karney
2013), or \code{"rhumb"} (loxodrome / constant-bearing).}
}
\value{
A \link[units:units]{units::units} vector of distances.
}
\description{
Computes the distance between the centroids of pairs of A5 cells
using the specified method.
}
\examples{
a <- a5_lonlat_to_cell(-3.19, 55.95, resolution = 24)
b <- a5_lonlat_to_cell(-3.10, 55.90, resolution = 24)
a5_cell_distance(a, b)
a5_cell_distance(a, b, units = "km")
a5_cell_distance(a, b, method = "geodesic")
}
\seealso{
\code{\link[=a5_cell_to_lonlat]{a5_cell_to_lonlat()}} for cell centroids,
\code{\link[=a5_cell_area]{a5_cell_area()}} for cell areas.
}
