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

Function TestIntercept

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

Source from the content-addressed store, hash-verified

34}
35
36func TestIntercept(t *testing.T) {
37 p := Point{0, 3}
38 var slope float64 = -5
39 var wantedIntercept float64 = 3
40 var calculatedIntercept float64 = YIntercept(&p, slope)
41 if calculatedIntercept != wantedIntercept {
42 t.Fatalf("Failed to calculate YIntercept.")
43 }
44}
45
46func TestIsParallel(t *testing.T) {
47 l1 := Line{P1: Point{1, 2}, P2: Point{2, 4}}

Callers

nothing calls this directly

Calls 1

YInterceptFunction · 0.85

Tested by

no test coverage detected