Exemplo n.º 1
0
        private static double[] ForFour(List <Point> points, int p0)
        {
            var KT = CountingAlgoritm.CountPoints(points);
            int k  = KT.K;
            int t  = KT.T;

            var m12 = (IMarking)PointMarking90.MarkContourPoints(points);
            int m1  = m12.CountNegativeAngles;
            int m2  = m12.CountPositiveAngles;

            var m34 = (IMarking)PointMarking135.Build(points);
            int m3  = m34.CountNegativeAngles;
            int m4  = m34.CountPositiveAngles;

            var orientations = PointCounter.ToCountPoints(points);

            var Lln   = 0.5d * (k * 2d * A + (double)t * 2 * B);
            var Lvp   = 0.5d * (m1 * 2d * B + m3 * (A + B));
            var Lvg   = 0.5d * (m2 * 2d * B + m4 * (A + B));
            var Lkont = GetLkont(orientations);

            double k1 = m1 / p0;
            double k2 = m2 / p0;
            double k3 = m3 / p0;
            double k4 = m4 / p0;
            double k5 = k / p0;
            double k6 = t / p0;
            double k7 = Lln / Lkont;
            double k8 = Lvg / Lkont;
            double k9 = Lvp / Lkont;

            return(new double[] { k1, k2, k3, k4, k5, k6, k7, k8, k9 });
        }