/** * Return the leaf cell containing the given point (a direction vector, not * necessarily unit length). */ public static function fromPoint(S2Point $p) { $face = S2Projections::xyzToFace($p); $uv = S2Projections::validFaceXyzToUv($face, $p); $i = self::stToIJ(S2Projections::uvToST($uv->x())); $j = self::stToIJ(S2Projections::uvToST($uv->y())); return self::fromFaceIJ($face, $i, $j); }