Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Consider a canonical eliptical cone C with its vertex at the origin, with height h, and with a base given by:

(x/a)2+(y/b)2 = 1; z = h

a, b not equal to 0. Given a point p = (px, py, pz) how would you determine if p is interior to C? I realize 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 pz/h and see if p is inside the ellipse:

(h/pz)2[(x/a)2+(y/b)2]=1; z = pz

Are there other approaches? Thanks.

share|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
1  
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
add comment

1 Answer

up vote 5 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|improve this answer
add comment

Your Answer

 
discard

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.