// The Euclidean distance is a measure of the straight-line distance
// between two points in a 2D or 3D space
package main
import (
"fmt"
"math"
)
// CalculateEuclideanDistance computes the Euclidean distance between two 2D points
func CalculateEuclideanDistance(x1, y1, x2, y2 float64) float64 {
return math.Sqrt(math.Pow(x2-x1, 2) + math.Pow(y2-y1, 2))
}
func main() {
x1, y1 := 3.0, 4.0
x2, y2 := 5.0, 9.0
distance := CalculateEuclideanDistance(x1, y1, x2, y2)
fmt.Printf("Euclidean Distance: %.5f\n", distance)
}
/*
run:
Euclidean Distance: 5.38516
*/