Learn R Programming

shotGroups (version 0.1)

getMaxPairDist: Maximum pairwise distance for a set of points

Description

Calculates the maximum of pairwise distances between points given a set of coordinates.

Usage

getMaxPairDist(xy)

Arguments

xy
a numerical (n x p)-matrix with the coordinates of n points in p-dimensional space (1 row of coordinates per point).

Value

  • A list with the following components
  • dnumerical value with the maximum pairwise distance between points.
  • idxa vector with two entries giving the row indices of the points that are farthest apart.

Examples

Run this code
xy <- matrix(round(rnorm(20, 100, 15), 1), ncol=2)
getMaxPairDist(xy)

Run the code above in your browser using DataLab