A lattice point is visible from the origin if there is no other lattice point on the segment , which happens if and only if . The proportion of such lattice points is .
This Demonstration uses that fact to approximate π. The blue points represent the lattice points that are visible from the origin, and the red points those that are not visible. The pitch of the sound is proportional to the GCD of the current point.