SpatEntropy (version 0.1.0)

euclid_dist: Euclidean distance.

Description

euclid_dist computes the Euclidean distance between all point couples/pairs identified by two coordinate matrices. Useful alone, or together with adj_mat().

Usage

euclid_dist(coords1, coords2 = coords1)

Arguments

coords1

A two column matrix containing starting coordinates. Provided by user or as output of coords_pix().

coords2

A two column matrix with containing coordinates, same as coords1 by default.

Value

An upper-triangular distance matrix: a nrow(coords1) x nrow(coords2) matrix with Euclidean distances between points.

Details

euclid_dist needs two matrices listing the coordinates of two sets of points. It computes the Euclidean distance between each point of the first matrix and all points of the second matrix. The default option provides the Euclidean distance between all points in a single set.

Examples

Run this code
# NOT RUN {
euclid_dist(cbind(runif(10), runif(10)))

# }

Run the code above in your browser using DataLab