4
$\begingroup$

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?

$\endgroup$
2
  • $\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é
    Commented Oct 14, 2014 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$ Commented Nov 9, 2014 at 20:08

0

Browse other questions tagged .