class Point { float x; float y; Point( float xIn, float yIn ) { x = xIn; y = yIn; } } Point sampleUnitSquare() { float x = random(1); float y = random(1); return new Point( x, y ); } void setup() { size( 500, 500 ); } void draw() { filter( BLUR, 1 ); for( int idx = 0; idx < 100; ++idx ) { Point a_point = sampleUnitSquare(); ellipse( a_point.x * width, a_point.y * height, 10, 10 ); } }