Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I find minimum distance between cone and a point ?

Cone properties :
position - $(0,0,z)$
radius - $R$
height - $h$

Point properties:
position - $(0,0,z_1)$

share|cite|improve this question
Are you only interested in the given trivial case or one for any point? – Karolis Juodelė Nov 25 '12 at 12:42
@KarolisJuodelė any point – jques Nov 25 '12 at 12:57
up vote 0 down vote accepted

I assume a right cone.

Put all shapes into a cylindrical coordinate system $(\phi, r, h)$, such that the axis of the cone satisfies $r = 0$. Now, by symmetry of cone, you can throw away $\phi$ and work in two dimensions.

You now have an isosceles triangle with point $A$ at the top and $B$ on the bottom, closer to the given point $X$. Now, the distance is given by $$\begin{cases}0 & X_h \geq B_h \wedge \vec{X}\cdot \vec{n} < \vec{A} \cdot \vec{n} \\B_h - X_h& X_h < B_h \wedge X_r < B_r \\AX^2-\Big(\frac{\vec{AX}\cdot\vec{AB}}{AB} \Big)^2 & \vec{AX}\cdot\vec{AB} \geq 0 \wedge \vec{BX}\cdot\vec{BA} \geq 0 \\ \min \{AX, BX\}& otherwise\end{cases}$$

Here $X_h, X_r$ indicate the two coordinates of $X$, $\cdot$ is the inner product and $\vec{n}$ is a normal of $AB$ pointing outwards.

It is surely a mess, but I don't know is anything cleaner can be expected.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.