(t *testing.T)
| 157 | } |
| 158 | |
| 159 | func TestCapContainsPoint(t *testing.T) { |
| 160 | tangent := tiny.center.Cross(r3.Vector{X: 3, Y: 2, Z: 1}).Normalize() |
| 161 | tests := []struct { |
| 162 | c Cap |
| 163 | p Point |
| 164 | want bool |
| 165 | }{ |
| 166 | {xAxis, xAxisPt, true}, |
| 167 | {xAxis, Point{r3.Vector{X: 1, Y: 1e-20, Z: 0}}, false}, |
| 168 | {yAxis, xAxis.center, false}, |
| 169 | {xComp, xAxis.center, true}, |
| 170 | {xComp.Complement(), xAxis.center, false}, |
| 171 | {tiny, Point{tiny.center.Add(tangent.Mul(tinyRad * 0.99))}, true}, |
| 172 | {tiny, Point{tiny.center.Add(tangent.Mul(tinyRad * 1.01))}, false}, |
| 173 | {hemi, PointFromCoords(1, 0, -(1 - epsilon)), true}, |
| 174 | {hemi, xAxisPt, true}, |
| 175 | {hemi.Complement(), xAxisPt, false}, |
| 176 | {concaveMax, PointFromLatLng(LatLngFromDegrees(-70*(1-epsilon), 10)), true}, |
| 177 | {concaveMin, PointFromLatLng(LatLngFromDegrees(-70*(1+epsilon), 10)), false}, |
| 178 | {concaveMax, PointFromLatLng(LatLngFromDegrees(-50*(1-epsilon), -170)), true}, |
| 179 | {concaveMin, PointFromLatLng(LatLngFromDegrees(-50*(1+epsilon), -170)), false}, |
| 180 | } |
| 181 | for _, test := range tests { |
| 182 | if got := test.c.ContainsPoint(test.p); got != test.want { |
| 183 | t.Errorf("%v.ContainsPoint(%v) = %t, want %t", test.c, test.p, got, test.want) |
| 184 | } |
| 185 | } |
| 186 | } |
| 187 | |
| 188 | func TestCapInteriorIntersects(t *testing.T) { |
| 189 | tests := []struct { |
nothing calls this directly
no test coverage detected
searching dependent graphs…