I have created a 3D rendering of the moon, which is represented as a sphere with a radius of N pixels.

I also have selenographic coordinates. For example, the coordinates of the Apollo 11 landing site are 0.67408, 23.47297. I'd like to show this coordinate on my sphere.

Here's some possibly relevant code, which is used for conversion with Earth coordinates:

function latLongToVector3(lat, lon, radius, height) {
    var phi = (lat)*Math.PI/180;
    var theta = (lon-180)*Math.PI/180;

    var x = -(radius+height) * Math.cos(phi) * Math.cos(theta);
    var y = (radius+height) * Math.sin(phi);
    var z = (radius+height) * Math.cos(phi) * Math.sin(theta);

    return new THREE.Vector3(x,y,z);

Is this the correct way to map selenographic coordinates onto a sphere?


closed as unclear what you're asking by Sir Cumference, called2voyage Oct 4 '16 at 17:42

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • $\begingroup$ I'm not sure what your question is but the source code seems to be ok if you take $y$ to be the axis along the polar axis. Usually $z$ is used for this axis. $\endgroup$ – Dieudonné Oct 14 '14 at 7:56
  • 1
    $\begingroup$ What's the question? The Moon is a oblate sphere like the Earth so your code would work if you are looking for approximations, yes. $\endgroup$ – adrianmcmenamin Nov 9 '14 at 20:08

Browse other questions tagged or ask your own question.