Learn R Programming

UKFE (version 1.0.2)

NGRDist: British national grid reference (NGR) distances

Description

Calculates the Euclidean distance between two British national grid reference points using the Pythagorean/Euclidean method.

Usage

NGRDist(i, j)

Value

A distance in kilometres (if British national grid easting and northing are applied)

Arguments

i

a numeric vector of length two. The first being the easting and the second being the northing of the first site

j

a numeric vector of length two. The first being the easting and the second being the northing of the second site

Author

Anthony Hammond

Details

Note, that the result is converted to km from m.

Examples

Run this code
# Calculate the distance between the catchment centroid for the
# Kingston upon Thames river gauge and the catchment centroid for the
# gauge at Ardlethen on the River Ythan.
# First retrieve the catchment descriptors (CDs) to obtain eastings and northings
GetCDs(10001)
GetCDs(39001)

# Calculate the distance between two centroids (eastings and northings)
NGRDist(i = c(381355, 839183), j = c(462899, 187850))

Run the code above in your browser using DataLab