Example #1
0
        public double Calculate(Region region)
        {
            double square    = squareSign.Calculate(region);
            double perimeter = perimeterSign.Calculate(region);

            return(perimeter * perimeter / square);
        }
Example #2
0
        public double Calculate(Region region)
        {
            Point center = centerOfMass.Calculate(region);

            return(region.Infos.Select(pixel =>
                                       Math.Pow(pixel.Coords.X - center.X, i) * Math.Pow(pixel.Coords.Y - center.Y, j))
                   .Sum());
        }