146147148149150151152153154155156
public static PolarCoordinates uniformOnDisc(double radius, double ru, double rv) { assert(0.0 <= ru && ru <= 1.0); assert(0.0 <= rv && rv <= 1.0); return new PolarCoordinates( 2.0 * Math.PI * ru, radius * Math.sqrt(rv) ); }