$coordinates) { $space->addPoint($coordinates); } // cluster these 50 points in 3 clusters $clusters = $space->solve(3); // display the cluster centers and attached points foreach ($clusters as $num => $cluster) { $coordinates = $cluster->getCoordinates(); printf( "Cluster %s [%d,%d]: %d points\n", $num, $coordinates[0], $coordinates[1], count($cluster) ); }