Sphere Point Picking in Cartesian cordiantes

87 Views Asked by At

I have a vector A(x, y, z). Now I want to rotate the vector randomly (x by $\phi$, y by $\theta$ and z by $\psi$) in the 3D plane.

I want to pick points randomly on a sphere so that they are uniformly distributed. Preferably in the Cartesian coordinate.

2

There are 2 best solutions below

0
On

One solution is to pick λ ∈ [-180°, 180°) as before and then set φ = cos-1(2x - 1), where x is uniformly distributed and x ∈ [0, 1).

0
On

This has been solved. One can try the following:

$x$ = $\sqrt[3]{u}\sqrt{1-v^2}\cos\theta$

$y$ = $\sqrt[3]{u}\sqrt{1-v^2}\sin\theta$

$z$ = $\sqrt[3]{u} v$

where $u$ = $r^3$ ($r = \sqrt{x^2+y^2+z^2}$)

$\theta\in [0, 2\pi]$ and $v \in [-1,1]$

For further study see this link http://mathworld.wolfram.com/SpherePointPicking.html