示例#1
0
        /*
         * CalculateLaplacianValue_B returns the new calculated A value based on the algorthim specs.
         */
        public double CalculateLaplacianValue_B(Cell cell)
        {
            //double neighboursAverage = (cell.Top.B + cell.TopLeft.B + cell.Left.B + cell.BottomLeft.B + cell.Bottom.B + cell.BottomRight.B + cell.Right.B + cell.TopRight.B) / 8;
            double neighboursAverage = (cell.GetCellneighbour(7).B + cell.GetCellneighbour(0).B + cell.GetCellneighbour(1).B + cell.GetCellneighbour(2).B + cell.GetCellneighbour(3).B + cell.GetCellneighbour(4).B + cell.GetCellneighbour(5).B + cell.GetCellneighbour(6).B) / 8;

            return(neighboursAverage - cell.B);
        }
        /*
         * CalculateLaplacianValue_B returns the new calculated B value based on the algorthim specs.
         */
        public double CalculateLaplacianValue_B(Cell cell)
        {
            double h  = 2.5 / 127.0;
            double rh = 1.0 / h / h;
            //double SumOfNeighbours = cell.Top.B + cell.Left.B + cell.Bottom.B + cell.Right.B;
            double SumOfNeighbours = cell.GetCellneighbour(7).B + cell.GetCellneighbour(1).B + cell.GetCellneighbour(3).B + cell.GetCellneighbour(5).B;

            return(rh * ((SumOfNeighbours) - (4 * cell.B)));
        }
示例#3
0
        /*
         * CalculateLaplacianValue_B returns the new calculated A value based on the algorthim specs.
         */
        public double CalculateLaplacianValue_B(Cell cell)
        {
            //double cornerSum = (cell.TopLeft.B + cell.TopRight.B + cell.BottomLeft.B + cell.BottomRight.B) * 0.05;
            double cornerSum = (cell.GetCellneighbour(0).B + cell.GetCellneighbour(6).B + cell.GetCellneighbour(2).B + cell.GetCellneighbour(4).B) * 0.05;
            //double perpendicularSum = (cell.Top.B + cell.Left.B + cell.Bottom.B + cell.Right.B) * 0.2;
            double perpendicularSum = (cell.GetCellneighbour(7).B + cell.GetCellneighbour(1).B + cell.GetCellneighbour(3).B + cell.GetCellneighbour(5).B) * 0.2;
            double middle           = cell.B * -1;

            return(cornerSum + perpendicularSum + middle);
        }