Esempio n. 1
0
        private bool FormsEar(int A, int B, int C)
        {
            wVector V0 = new wVector(pgon.Points[A], pgon.Points[B]);
            wVector V1 = new wVector(pgon.Points[C], pgon.Points[B]);

            if (V0.GetAngle(V1) > 0)
            {
                return(false);
            }

            wPolyline triangle = new wPolyline(new wPoint[] { pgon.Points[A], pgon.Points[B], pgon.Points[C] });

            for (int i = 0; i < pgon.Points.Count; i++)
            {
                if ((i != A) && (i != B) && (i != C))
                {
                    if (triangle.IsPointInside(pgon.Points[i]))
                    {
                        return(false);
                    }
                }
            }

            return(true);
        }