Learn R Programming

Momocs (version 0.2-6)

ed: Calculates euclidean distance between two points.

Description

ed simply calculates euclidean distance between two points defined by their (x; y) coordinates. This function is used internally but may be of interest for other analyses.

Usage

ed(pt1, pt2)

Arguments

pt1
(x; y) coordinates of the first point.
pt2
(x; y) coordinates of the second point.

Value

  • Returns the euclidean distance between the two points.

See Also

edm, edm.nearest, dist.

Examples

Run this code
ed(c(0,1), c(1,0)) # sqrt 2

Run the code above in your browser using DataLab