# find center of sphere, of sphere inscribed into cone at deepest position

How to inscribe a ball into a cone? If I position a ball into a cone at the deepest position possible, cut a plane centric through that 3D object and just look at that plane, then I assumed that: a) From the tangent points, the two lines running perpendicular from the tangents roughly towards the center of the ball (center of the circle, as seen in the plane) will cross exactly in the center of the ball (circle). b) The distance between the vertex of the cone and the center of the ball could thus be calculated as: d = ballradius / sin(halfconeangle). I now have to assume that something in my assumptions a) and b) is faulty (read about my doubts below). Are my assumptions correct? Would you know how to describe the geometrical situation correctly?

About my doubts: I have several examples drawn on paper, and measured “d”. But I measure different values than calculating them, and the error is getting bigger and bigger for smaller and even smaller angles. While there seems to be no obvious mismatch for drawings with a 60º, 40º,30º and 15º half cone angle and a 5.2 cm ball radius (all mismatches could be appointment to my drawing not being really exact), for a radius of a circle of about 1.1 cm and a half cone angle of 15º, 7.5º and 3.75º the error is already about 0.8 cm, 1 cm and 2 cm, an error so big that I exclude that my drawing would be sketched so bad. Actually, I was programming in MATLAB, and see such mismatch also there, but considering MATLAB I also would have to be sure that my code is correct. Indeed, observing such mismatch in the graphs drawn by my little MATLAB code, I suspected a failure in my MATLAB code and went for the classical paper method to first confirm that my assumptions a) and b) are correct. Now it looks as if my MATLAB code and my drawing might not be the problem, but the paper work suggests, that my math knowledge is bad. I am lost, and would really appreciate your help.

-
Hm this gives the intersection curves: mathworld.wolfram.com/Cone-SphereIntersection.html So how would the intersection curve(s) look in case of a prefect fit? – mvw May 22 '14 at 12:04
Your formula "$d = r/\sin\theta$" is correct for a ball of radius $r$ whose center lies on the axis of the cone, presuming by "half cone angle" $\theta$ you mean half the angle of the longitudinal section at the vertex. How are you using the numerical value of $\theta$ to specify the cone? – Andrew D. Hwang May 22 '14 at 12:10
It is just to have the cone being represented in 2D by two lines meeting at a given angle in a point (vertex). Then drawing the circle, representing a sphere, between those two lines, coming as close to the point as possible, so that there finally arise 2 tangent points, one on the right side, and one on the left side of the circle. Shouldn´t a right angle triangle span from the vertex of the cone to a tangent point to the center of the sphere and back to the vertex let me calculate the spheres center coordinate "z" by using sin function? "x" and "y" would be the ones of the vertex at (0,0,0)? – Talby May 22 '14 at 12:33
@user86418: exactly this is what I intend to do. In my table calculator in DEG mode I just type for a 60º cone and a ball of radius 5.2 the following: 5.2 / sin(30). Result = 10.4 . In MATLAB I type d = radius / sin(halfconeangle*(pi/180)) and I get the same result. Was this your question? – Talby May 22 '14 at 12:39
@Talby: Yes, that does answer my question. In any case, your formula is correct. :) If the error is between the formula and measured distances with small angles, the problem may simply be due to measurement error. When $\theta$ is small, $\sin\theta$ is also small, so $d$ is "highly sensitive" to small changes in $\theta$. – Andrew D. Hwang May 22 '14 at 13:03

The formula "$d = r/\sin\theta$" is correct for a ball of radius $r$ whose center lies on the axis of the cone, presuming by "half cone angle" $\theta$ you mean half the angle of the longitudinal section at the vertex.
Here are pictures I'm getting for $\theta = 10$, $5$, and $3$ (degrees).
Certainly we have $h = \dfrac{r}{\sin\theta}$.
If you're getting bad answers, maybe you are confusing degrees and radians? This formula requires that $\theta$ is measured in radians, not in degrees.