Hi, my game is played on the surface of a planet (which is basically a sphere). I need to be able to translate between scene coordinates (cartesian x, y and z axes) and polar coordinates (alpha, beta and distance as used by the arc rotate camera).

Using my basic knowledge of trigonometry, I figured out this routine:

```
const polarToCartesian = function(position) {
const alpha = position.x;
const beta = position.y;
const distance = position.z
const x = -Math.sin(alpha) * Math.cos(beta) * distance;
const y = Math.cos(alpha) * Math.cos(beta) * distance;
const z = Math.cos(alpha) * Math.sin(beta) * distance;
return new BABYLON.Vector3(x, y, z);
}
```

This works perfectly and allowed me to create a ground mesh that covers part of a sphere, but my math knowledge is not enough to figure out the reverse

```
const cartesianToPolar = function(position) {
const x = position.x;
const y = position.y;
const z = position.z;
const alpha = ???;
const beta = ???;
const distance = Math.sqrt(x * x + y * y + z * z);
return new BABYLON.Vector3(alpha, beta, distance);
}
```

Is there anyone here with the math skill to figure this out, or alternatively are there helper classes in Babylon that can help with this kind of conversion?

Note that this page and this page are not the answer because they define the angles differently from the way that the arc rotate camera does it.

If you want to see how I am using the arc rotate camera, refer to this PG