title: Calculating Random Nearby Position Points In Javascript
body: <p>I have been trying to calculate random points within a certain distance of my base point. So far, the points are showing up typically appearing skewed. I think it has to do with Cardinal directions, but am unsure.</p>
  <p>Ideas?</p>
  <p>I am using the following code to find what to add to latitude and longitude.</p>
  <pre><code>       
  var positionOne = (Math.random() * (.002 - .0001) + .0001).toFixed(4);
  var positionTwo = (Math.random() * (.002 - .0001) + .0001).toFixed(4);
  var random_boolean_one = Math.random() &lt; 0.5;
  var random_boolean_two = Math.random() &lt; 0.5;
  
         if(random_boolean_one)
  {
  positionOne = positionOne * -1; 
  }
  if(random_boolean_two)
  {
  positionTwo = positionOne * -1; 
  }
  
  var newMarker = new atlas.HtmlMarker({
  color: 'DodgerBlue',
  position: [-90.048 + positionOne, 35.149 + positionTwo],
  })
  markers.push(newMarker);
  map.markers.add(newMarker);
  }
  </code></pre>