private function square($x, $y, $size, $offset)
    {
        $a = $this->getCellHeight($x - $size, $y - $size, $size);
        $b = $this->getCellHeight($x + $size, $y + $size, $size);
        $c = $this->getCellHeight($x - $size, $y + $size, $size);
        $d = $this->getCellHeight($x + $size, $y - $size, $size);

        $average = ($a + $b + $c + $d) / 4;
        $this->terra[$x][$y] = $average + $offset;

        $this->diamond($x, $y - $size, $size, $this->getOffset($size));
        $this->diamond($x - $size, $y, $size, $this->getOffset($size));
        $this->diamond($x, $y + $size, $size, $this->getOffset($size));
        $this->diamond($x + $size, $y, $size, $this->getOffset($size));
    }
private function square($x, $y, $size, $offset)
    {
        $a = $this->getCellHeight($x - $size, $y - $size, $size);
        $b = $this->getCellHeight($x + $size, $y + $size, $size);
        $c = $this->getCellHeight($x - $size, $y + $size, $size);
        $d = $this->getCellHeight($x + $size, $y - $size, $size);

        $average = ($a + $b + $c + $d) / 4;
        $this->terra[$x][$y] = $average + $offset;

        $this->diamond($x, $y - $size, $size, $this->getOffset($size));
        $this->diamond($x - $size, $y, $size, $this->getOffset($size));
        $this->diamond($x, $y + $size, $size, $this->getOffset($size));
        $this->diamond($x + $size, $y, $size, $this->getOffset($size));
    }
private function square ( $ x , $ y , $ size , $ offset ) { $ a = $ this -> getCellHeight ( $ x - $ size , $ y - $ size , $ size ) ; $ b = $ this -> getCellHeight ( $ x + $ size , $ y + $ size , $ size ) ; $ c = $ this -> getCellHeight ( $ x - $ size , $ y + $ size , $ size ) ; $ d = $ this -> getCellHeight ( $ x + $ size , $ y - $ size , $ size ) ; $ average = ( $ a + $ b + $ c + $ d ) / 4 ; $ this -> terra [ $ x ] [ $ y ] = $ average + $ offset ; $ this -> diamond ( $ x , $ y - $ size , $ size , $ this -> getOffset ( $ size ) ) ; $ this -> diamond ( $ x - $ size , $ y , $ size , $ this -> getOffset ( $ size ) ) ; $ this -> diamond ( $ x , $ y + $ size , $ size , $ this -> getOffset ( $ size ) ) ; $ this -> diamond ( $ x + $ size , $ y , $ size , $ this -> getOffset ( $ size ) ) ; }
Definition of height middle point in square

@param $x      int
@param $y      int
@param $size   int
@param $offset float
Definition of height middle point in square