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

<p>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.</p>

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

<pre><code>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);
}
</code></pre>

<p>Is this the correct way to map selenographic coordinates onto a sphere?</p>

CC BY-SA 3.0
2014-10-14T07:56:26.240Z
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.
Dieudonné
CC BY-SA 3.0
2014-11-09T20:08:37.717Z
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.
adrianmcmenamin
<the-moon>
Mapping selenographic coordinates onto a sphere
ty.
# Mapping selenographic coordinates onto a sphere

(Asked by: username_0 on 2014-10-14)

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?

**Tags:** the-moon

> **Comments:**
> **username_1**: 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.  
> **username_2**: 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.  

---

## 0 answers

