MCPcopy Index your code
hub / github.com/tdewolff/canvas / TestIntersectionCircleCircle

Function TestIntersectionCircleCircle

path_intersection_test.go:34–55  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

32}
33
34func TestIntersectionCircleCircle(t *testing.T) {
35 var tts = []struct {
36 c0 Point
37 r0 float64
38 c1 Point
39 r1 float64
40 p0, p1 Point
41 }{
42 {Point{0.0, 0.0}, 1.0, Point{2.0, 0.0}, 1.0, Point{1.0, 0.0}, Point{1.0, 0.0}},
43 {Point{0.0, 0.0}, 1.0, Point{1.0, 1.0}, 1.0, Point{1.0, 0.0}, Point{0.0, 1.0}},
44 {Point{0.0, 0.0}, 1.0, Point{3.0, 0.0}, 1.0, Point{}, Point{}},
45 {Point{0.0, 0.0}, 1.0, Point{0.0, 0.0}, 1.0, Point{}, Point{}},
46 {Point{0.0, 0.0}, 1.0, Point{0.5, 0.0}, 2.0, Point{}, Point{}},
47 }
48 for i, tt := range tts {
49 t.Run(fmt.Sprint(i), func(t *testing.T) {
50 p0, p1, _ := intersectionCircleCircle(tt.c0, tt.r0, tt.c1, tt.r1)
51 test.T(t, p0, tt.p0)
52 test.T(t, p1, tt.p1)
53 })
54 }
55}
56
57func TestIntersectionLineLine(t *testing.T) {
58 var tts = []struct {

Callers

nothing calls this directly

Calls 3

intersectionCircleCircleFunction · 0.85
TMethod · 0.80
RunMethod · 0.45

Tested by

no test coverage detected