# Coordinate on sphere(vector calculus)

## Main Question or Discussion Point

I have a sphere, with center x0,y0,z0 and a radius r.
Furthermore I have a point 1 outside the sphere x1,y1,z1.
But now I want to calculate the coordinates of Point 2, which is on the surface of the sphere, and the CenterP2P1 is 90 degrees there.

With these two points known points (Center & P1), I want to make a triangle.
Sides:
- Center - P1 (length calculated by Euclidean distance)
- Center - P2 (length = radius of the sphere)
- P1 - P2 (length = Pythagoras formula)

With Euclidean distances it is easy to calculate all the lengths of all the sides.

But can someone point me towards the possible very simple solution of this problem, how to calculate the coordinate of point 2?

You don't have enough information to calculate the co ordinates.

You need the distance from another known point.

If we set up an orthonormal (Cartesian) coordinate system with its origin at the centre of the sphere, then we can represent point 2 with a position vector r extending from the origin to the surface of the sphere, and point 1 with another position vector p.

$$\left ( \textbf{p}-\textbf{r} \right ) \cdot \textbf{r} = 0$$

$$\textbf{r} \cdot \textbf{p} = \textbf{r} \cdot \textbf{r} = \left \| \textbf{r} \right \|^2$$

$$\left \| \textbf{p} \right \| \; \cos\left ( \textbf{p},\textbf{r} \right )=\left \| \textbf{r} \right \|$$

$$\sum_{k=1}^{3}r_k \; p_k = \sum_{k=1}^{3}r_k \; r_k$$

where $r_1$ is the x-component of r, and $r_2$ its y-component, and so on. And cos(p,r) is the cosine of the angle between the position vectors of the two points.

But there are infinitely many vectors r that satisfy this condition. They describe a circle on the surface of the sphere. You would need some other condition to uniquely identify a particular point P2 on the surface with this property.