powered by
DistanceSq(point1, point2, dimensions=length(point1))
# Creating two points. point1 <- c(0, 2, 4, 6) point2 <- c(0, 1, 2, 3) # Calculating the square distance between the two points # in 4 dimensions. DistanceSq(point1, point2, 4)
Run the code above in your browser using DataLab