A vector of length \(d\) holding the corresponding Cartesian coordinates
$$\left(r\prod_{i=1}^{d-1}\cos\theta_i, r\sin\theta_1\prod_{i=2}^{d-1}\cos\theta_i, r\sin\theta_2\prod_{i=3}^{d-1}\cos\theta_i,\dots, r\sin\theta_{d-2}\cos\theta_{d-1}, r\sin\theta_{d-1}\right),$$
where \(r\) is given by p[1] and \(\theta_i\) is given by p[i+1] for \(i=1,\dots,d-1\).
Arguments
p
A vector of length \(d\) \((d\ge 2)\) with the first element being the radius and the others being the angles,
where p[2] takes values in \([0,2\pi]\) and p[i] takes values in \([-\pi/2,\pi/2]\), for all \(i>2\) if any.