Ejemplo n.º 1
0
        public void Test_S2ContainsVertexQuery_CompatibleWithAngleContainsVertexDegenerate()
        {
            S2Point a = new(1, 0, 0), b = new(0, 1, 0);
            S2ContainsVertexQuery q = new(b);

            q.AddEdge(a, -1);
            q.AddEdge(a, 1);
            Assert.Equal(q.ContainsSign() > 0, S2.AngleContainsVertex(a, b, a));
        }
Ejemplo n.º 2
0
        public void Test_S2ContainsVertexQuery_CompatibleWithAngleContainsVertex()
        {
            var points = S2Testing.MakeRegularPoints(MakePointOrDie("89:1"),
                                                     S1Angle.FromDegrees(5), 10);
            S2PointLoopSpan loop = new(points);

            for (int i = 0; i < loop.Count; ++i)
            {
                S2Point a = loop[i];
                S2Point b = loop[i + 1];
                S2Point c = loop[i + 2];
                S2ContainsVertexQuery q = new(b);
                q.AddEdge(a, -1);
                q.AddEdge(c, 1);
                Assert.Equal(q.ContainsSign() > 0, S2.AngleContainsVertex(a, b, c));
            }
        }