dis_eval: Returns the euclidean distance between two given points in...

View source: R/dis_eval.R

dis_evalR Documentation

Returns the euclidean distance between two given points in any n-dimensional space

Description

Function returns the euclidean distance metric between any two points

Usage

dis_eval(v1, v2)

Arguments

v1

The first n-dimensional vector

v2

The second n-dimensional vector

Details

The length of the vectors need to be the same else an error would be returned.

Value

The returned value is always a scalar

Author(s)

Chitran Ghosal

Examples

p1 <- c(1, 4, 6)
p2 <- c(2, 5, 7)
p3 <- c(1, 2)
p4 <- c(4, 6)
dis_eval(p1, p2)
dis_eval(p1, p3)
dis_eval(p1, p4)
dis_eval(p2, p3)
dis_eval(p2, p4)
dis_eval(p3, p4)

Chitran1987/StatsChitran documentation built on Feb. 23, 2025, 8:30 p.m.