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

Function TestSection

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

Source from the content-addressed store, hash-verified

15}
16
17func TestSection(t *testing.T) {
18 p1 := Point{1, 0}
19 p2 := Point{5, 0}
20 wantedPoint := Point{3, 0}
21 calculatedPoint := Section(&p1, &p2, 1)
22 if calculatedPoint != wantedPoint {
23 t.Fatalf("Failed to calculate Section.")
24 }
25}
26
27func TestSlope(t *testing.T) {
28 line := Line{P1: Point{1, 2}, P2: Point{2, 4}}

Callers

nothing calls this directly

Calls 1

SectionFunction · 0.85

Tested by

no test coverage detected