protected function getQuadrant($point, $center) { $quad = 0; if ($point['x'] >= $center['x']) { $quad = $point['y'] >= $center['y'] ? 4 : 1; } else { $quad = $point['y'] >= $center['y'] ? 3 : 2; } return $quad; }