# Mapping Coordinates on a Plane Tangent to a Sphere into Cartesian Coordinates in 3D Space

Before we begin, I must ask you to keep the vocabulary at high school level.

These variables define the point the plane needs to be tangent to – the center of the circle is at the origin.
r - defines the radius of the sphere
Ø1 – defines the rotation in the x-z axis – can be from 0 to 2π
Ø2 – defines the rotation in the y axis – can be from 0 to π  I have found that I can convert that point on the sphere to Cartesian coordinates using equations.
x0=r•cosØ1•sinØ2
z0=r•sinØ1•sinØ2
y0=r•cosØ2

These variables define the location of the point to be converted on the 2d plane that is tangent to the sphere.
d1 – is the x coordinate
d2 – is the y coordinate

Positive y for the 2d plane is in the vertical direction as much as possible (because the plane is tangent to the sphere), positive x is in the counterclockwise direction looking down on the sphere from positive y in 3d space (or to the right if the plane is on your side of the sphere). The formulas I have made are:

x1=x0+d2•cosØ1•cosØ2-d1•sinØ1
z1=z0+d2•sinØ1•cosØ2+d1•cosØ1
y1=y0+d2•sinØ2

At this point I hope you understand what I am trying to do and can point me to where I’ve gone wrong.

• In your first picture, it looks like your $z$ is pointing backward? By right hand rule, it should point outward. Also, I don't understand "Positive y for the 2d plane is in the vertical direction as much as possible, positive x is in the counterclockwise direction looking down on the sphere from positive y in 3d space." Is your plane parallel to $xz$? – KittyL Feb 15 '15 at 9:38
• @KittyL The 2d plane would only be parallel to xz if it were on top of the sphere or on the bottom of the sphere because I am referring to the plane that is parallel to the surface of the sphere. What I meant by that was that the positive y direction is as vertical as possible, as the plane itself would in most cases be at a tilt. As for the z, I put it the way that it is because that is the direction that the y would be pointing if it were just an xy plane. It's probably not "correct", but it seems to make the most sense to me. – TheZouave Feb 16 '15 at 2:54
• Sorry I still don't understand the variables. If you can draw another picture with the 2d plane, that might explain better. Also for the z axis in the first picture, it really depends on where you stand to look at it so that it would be where the y would be pointing if it were xy plane. So better do it in the correct way. – KittyL Feb 16 '15 at 9:47
• And by the way, if you only want to find the equation of the plane that is tangent to the sphere, it should just be $x_0x+y_0y+z_0z=r^2$. – KittyL Feb 16 '15 at 11:50
• So I drew that picture you asked for and added it. I don't know how to work with an equation of a plane, it should be possible using only geometry and trig. – TheZouave Feb 17 '15 at 18:05

The first thing I did is I changed the axis to a more conventional format. All I really did is switch the y and z axis.

To that effect, this is the revised polar-to-cartesian coordinate conversion equations.
x0=r•cosØ1•sinØ2
y0=r•sinØ1•sinØ2
z0=r•cosØ2

This is the plane that is tangent to the sphere. These are the equations that convert coordinates on the plane into 3d cartesian coordinates. And the written version (in case you can't load images for some reason)
x1=x0-d2•cosØ1•cosØ2-d1•sinØ1
y1=y0-d2•sinØ1•cosØ2+d1•cosØ1
z1=z0+d2•sinØ2

This is a close-up on the diagrams. So you are asking to find the equation of the plane (or points $(x_1,y_1,z_1)$ on the plane) that is tangent to the sphere at the point $(x_0,y_0,z_0)$.

I will following the regular right hand rule, so the $z$ axis in your first picture should point outward. The $\theta_2$ starts from the positive $y$ direction.

So your $(x_0,y_0,z_0)$ in spherical coordinates is correct. Then you find the directive with respect to $theta_1,theta_2$ to find the tangent direction.

The new points are

$$x_1=x_0+d_2\cos{\theta_2}\cos{\theta_1}-d_1\sin{\theta_2}\sin{\theta_1}\\ z_1=z_0+d_2\cos{\theta_2}\sin{\theta_1}+d_1\sin{\theta_2}\cos{\theta_1}\\ y_1=y_0-d_1\sin{\theta_2}$$

• I don't know the regular right hand rule. Looking at the xy plane like normal(+x to right, +y up), is the positive z coming towards me or going away from me? – TheZouave Feb 18 '15 at 19:18
• It points toward you. – KittyL Feb 18 '15 at 19:37