I am using
$lat=rand(0-pi()*1000000,pi()*1000000)/1000000;
$lon=rand(0-pi()*1000000,pi()*1000000)/1000000;
to pick a random point on earth(in radians) however this method results in points being closer together near polls then near equator since 1 deg of $lon is a smaller distance near the polls then at the equator.
Any ideas on how to get a better distribution?