euclidean: Find euclidean distance between two points

Description Usage Arguments Details Value

View source: R/fun_euclidean.R

Description

Given two sets of coordinates, find euclidean distance between them in n-dimensional space.

Usage

1
euclidean(pt1, pt2)

Arguments

pt1, pt2

numeric vectors of length n; coordinates of points 1 and 2, respectively

Details

This is a simple vectorised calculation that returns the square root of the sum of squared differences between respective elements of x and y. It is used internally to calculate distances between points in a set and the set's centroid.

Value

a single number


olobiolo/centroidr documentation built on Dec. 3, 2019, 12:55 p.m.