I’m trying to generate random GPS locations withing a certain range; a square area defined using min and max positions.
float lat = ofRandom(51.954587, 51.992465); float lon = ofRandom(5.891907, 5.964681); ofLog() << lat << ", " << lon;
This results in a position like:
51.9607, 5.89286 51.966, 5.91742 51.9899, 5.91362 51.9913, 5.93712
As you can see the precision of the results is lower (maximum of 5 decimals) than the numbers entered into
ofRandom() (6 decimals), meaning there is a larger chance of getting ending up with the same location, plus the resulting list of points is not as dense as I’d like it to be.
Does anyone know a way to generate numbers with a higher precision?