public function getMedianOffset($Key, $X, $Y)
    {
        $Cpt = 1;
        if (isset($this->Data[$Key]["Connections"])) {
            foreach ($this->Data[$Key]["Connections"] as $NodeID) {
                if (isset($this->Data[$NodeID]["X"])
                    && isset($this->Data[$NodeID]["Y"])
                ) {
                    $X = $X + $this->Data[$NodeID]["X"];
                    $Y = $Y + $this->Data[$NodeID]["Y"];
                    $Cpt++;
                }
            }
        }
        return ["X" => $X / $Cpt, "Y" => $Y / $Cpt];
    }
public function getMedianOffset($Key, $X, $Y)
    {
        $Cpt = 1;
        if (isset($this->Data[$Key]["Connections"])) {
            foreach ($this->Data[$Key]["Connections"] as $NodeID) {
                if (isset($this->Data[$NodeID]["X"])
                    && isset($this->Data[$NodeID]["Y"])
                ) {
                    $X = $X + $this->Data[$NodeID]["X"];
                    $Y = $Y + $this->Data[$NodeID]["Y"];
                    $Cpt++;
                }
            }
        }
        return ["X" => $X / $Cpt, "Y" => $Y / $Cpt];
    }
public function getMedianOffset ( $ Key , $ X , $ Y ) { $ Cpt = 1 ; if ( isset ( $ this -> Data [ $ Key ] [ "Connections" ] ) ) { foreach ( $ this -> Data [ $ Key ] [ "Connections" ] as $ NodeID ) { if ( isset ( $ this -> Data [ $ NodeID ] [ "X" ] ) && isset ( $ this -> Data [ $ NodeID ] [ "Y" ] ) ) { $ X = $ X + $ this -> Data [ $ NodeID ] [ "X" ] ; $ Y = $ Y + $ this -> Data [ $ NodeID ] [ "Y" ] ; $ Cpt ++ ; } } } return [ "X" => $ X / $ Cpt , "Y" => $ Y / $ Cpt ] ; }
Get the median linked nodes position
@param string $Key
@param int $X
@param int $Y
@return array
Get the median linked nodes position