title: Lat Long to X Y Z position in JS .. not working
body: <pre><code>var phi   = (90-lat)*(Math.PI/180);
  var theta = (lng+180)*(Math.PI/180);
  
  marker_mesh.position.x = ((rad) * Math.sin(phi)*Math.cos(theta));
  marker_mesh.position.z = ((rad) * Math.sin(phi)*Math.sin(theta));
  marker_mesh.position.y = ((rad) * Math.cos(phi));
  </code></pre>
  
  <p>given the above my marker is not translating into the correct position on a 3D sphere ... thoughts? </p>
  
  <p>It is relatively close (on the same continent) but that close :\</p>
  
  <p>given below ... it should be rendering in at </p>
  
  <p><strong>lat</strong>: 41.7307619 <strong>long</strong>: -71.276195</p>
  
  <p>my globe has a <strong>boundRadius</strong>: 500px</p>
  
  <p>the current result of the function is</p>
  
  <p><strong>x:</strong> -119.7801015013779</p>
  
  <p><strong>y:</strong> 332.8157297895266</p>
  
  <p><strong>z:</strong> 353.3927238766871</p>
  
  <p><img src="https://i.stack.imgur.com/eHZGb.png" alt="enter image description here"></p>