MCPcopy Create free account
hub / github.com/TheAlgorithms/Go / TestPointDistance

Function TestPointDistance

math/geometry/straightlines_test.go:62–70  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

60}
61
62func TestPointDistance(t *testing.T) {
63 p := Point{1, 1}
64 equation := [3]float64{4, 3, 1}
65 var wantedDistance float64 = 1.6
66 var calculatedDistance float64 = PointDistance(&p, equation)
67 if calculatedDistance != wantedDistance {
68 t.Fatalf("Failed to calculate Point Distance.")
69 }
70}

Callers

nothing calls this directly

Calls 1

PointDistanceFunction · 0.85

Tested by

no test coverage detected