The Marsaglia polar method is a pseudo-random number sampling method for generating a pair of independent standard normal random variables.
Standard normal random variables are frequently used in computer science, computational statistics, and in particular, in applications of the Monte Carlo method.
The polar method works by choosing random points (x, y) in the square −1 < x < 1, −1 < y < 1 until
and then returning the required pair of normal random variables as
or, equivalently,
where x / s {\displaystyle x/{\sqrt {s}}} and y / s {\displaystyle y/{\sqrt {s}}} represent the cosine and sine of the angle that the vector (x, y) makes with x axis.