public static function C2s(array $p, &$theta, &$phi) {
    $x;
    $y;
    $z;
    $d2;

    $x  = $p[0];
    $y  = $p[1];
    $z  = $p[2];
    $d2 = $x * $x + $y * $y;

    $theta = ($d2 == 0.0) ? 0.0 : atan2($y, $x);
    $phi   = ($z == 0.0) ? 0.0 : atan2($z, sqrt($d2));

    return;
  }