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

Consider a canonical elliptical cone $C$ with its vertex at the origin, with height $h,$ and with a base given by: \begin{equation*} \left(\frac{x}{a}\right)^2+\left(\frac{y}{b}\right)^2=1;~z=h \end{equation*} for $a, b$ not equal to $0$. Given a point $p=(p_x,p_y,p_z)$, how would you determine if $p$ is interior to $C$? I realise I can first check to see if $p$ is outside of the elliptical right cylinder where one base the base of the elliptical cone and the other is on the $XY$ plane, so for grins, assume that check has already been made, and $p$ is in fact inside that cylinder. The most obvious solution I see is to linearly scale $a$ and $b$ by $\frac{p_z}{h}$ and see if $p$ is inside the ellipse: \begin{equation*} \left(\frac{h}{p_z}\right)^2\left[\left(\frac{x}{a}\right)^2+\left(\frac{y}{b}\right)^2\right]=1;~z=p_z. \end{equation*} Are there other approaches? Thanks.

share|cite|improve this question
Any other approach is going to be equivalent to the one you already have, so I'm not sure what you're looking for here. – Rahul Oct 1 '10 at 3:08
I'd say you need to clarify your question. All I see is an ellipse at height h, according to your first equation. I assume the height of your cone is h and its base is given by the ellipse equation? Anyhow, if this is the case, all you need to check is that p_z in [0,h] and ((p_x)/a')^2 + ((p_y)/b')^2 < 1, where a'=a(h-z)/h, similarly for b', which is rescaling indeed. – Weltschmerz Oct 1 '10 at 3:15
@Rahul: It's for a digital modeling project I'm working on, and I was hoping to see if there were other approaches that I could implement that might perform better. – andand Oct 1 '10 at 3:17
up vote 7 down vote accepted

Write down the equation for the cone: it is $$(x/a)^2 + (y/b)^2 - (z/h)^2 = 0.$$ Now the interior of the cone will be defined by the inequalities $$(x/a)^2 + (y/b)^2 - (z/h)^2 < 0 \text{ and } 0 < z < h.$$ So given a point $(x,y,z)$, assuming that $0 < z < h$ (so that at least the $z$-coordinate is compatible with lying in the interior of the cone), you evaluate $(x/a)^2 + (y/b)^2 - (z/h)^2$ and consider whether or not it is negative.

This is of course just a rephrasing of the description you give in your post, but it is the most practical test that I can think of, and should be easy to program.

NB: I am writing $(x,y,z)$ rather than $(p_x,p_y,p_z)$ just to make the notation simpler.

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.