Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Detect if a point is inside of a cone or not, in 3D space

Subject: Detect if a point is inside of a cone or not, in 3D space

From: Paulo

Date: 28 Apr, 2009 01:01:02

Message: 1 of 11

Hi everyone,

How is possible to detect if a 3D point is inside of a cone or not?

Thank you for your attention.

Subject: Detect if a point is inside of a cone or not, in 3D space

From: Roger Stafford

Date: 28 Apr, 2009 01:21:02

Message: 2 of 11

"Paulo " <paulofreitas7@portugalmail.pt> wrote in message <gt5kge$s4h$1@fred.mathworks.com>...
> How is possible to detect if a 3D point is inside of a cone or not?

  Hint: What can you say about the angle a line between the point in question and the cone vertex makes with the cone's central axis?

Roger Stafford

Subject: Detect if a point is inside of a cone or not, in 3D space

From: Gustavo Morales

Date: 28 Apr, 2009 02:33:01

Message: 3 of 11

Roger Stafford:

> Hint: What can you say about the angle a line between the point in question and the cone vertex makes with the cone's central axis?
>
> Roger Stafford

Roger Stafford:

First of all, sorry for my English.

Remember that a conic surface is that engendred by a straight line that moves in such way that always goes by a fixed curve and a fixed point not contained in the plane's curve.

"A fixed curve" could be whatever, (not necessarily a circle or an ellipse) so the angle you are talking could be variable and couldn't have any sense talking about an axis' cone
:(

Subject: Detect if a point is inside of a cone or not, in 3D space

From: Roger Stafford

Date: 28 Apr, 2009 03:40:03

Message: 4 of 11

"Gustavo Morales" <gustavo.morales.2000@gmail.com> wrote in message <gt5pst$n71$1@fred.mathworks.com>...
> Remember that a conic surface is that engendred by a straight line that moves in such way that always goes by a fixed curve and a fixed point not contained in the plane's curve.
> "A fixed curve" could be whatever, (not necessarily a circle or an ellipse) so the angle you are talking could be variable and couldn't have any sense talking about an axis' cone

  In English there are two definitions of a "cone", one of them a right-circular cone and the other the more general definition in terms of the "directrix" curve you speak of. Using the latter definition the problem can be reduced to projecting the given point onto a point in the plane of the directrix and determining whether the projected point lies inside that directrix. This last problem can be an easy or very difficult one depending on how the directrix is defined.

Roger Stafford

Subject: Detect if a point is inside of a cone or not, in 3D space

From: Gustavo Morales

Date: 28 Apr, 2009 04:07:01

Message: 5 of 11

Roger Stafford:
> In English there are two definitions of a "cone", one of them a right-circular cone and the other the more general definition in terms of the "directrix" curve you speak of. Using the latter definition the problem can be reduced to projecting the given point onto a point in the plane of the directrix and determining whether the projected point lies inside that directrix. This last problem can be an easy or very difficult one depending on how the directrix is defined.
>
> Roger Stafford

The same is in Spanish: Everybody can talk about a cone and they'll think in a circular cone, or a witch cap...... not in a "directrix" curve :-D ... We don't know what Paulo would want to say in this newsgroup...

 By other hand, I'm afraid I'm not agree with you Roger, because there's points outside the cone (circular or not) whose proyection in the directrix plane lies inside the area enclosed by the directrix. I'd like to show you in a drawing... but...

What do you think about my proposed idea to Paulo? Don't you think is simple? I'm assuming that he has the cone equation in general form, not in "spline form" or some other rare form.

Subject: Detect if a point is inside of a cone or not, in 3D space

From: Matt Fig

Date: 28 Apr, 2009 04:25:03

Message: 6 of 11

"Gustavo Morales" <gustavo.morales.2000@gmail.com> wrote in message
> By other hand, I'm afraid I'm not agree with you Roger, because there's points outside the cone (circular or not) whose proyection in the directrix plane lies inside the area enclosed by the directrix. I'd like to show you in a drawing... but...
>


That would depend on the projection. If by projection it is mean that a line is drawn from the point of the directrix through the point in question and through the plane containing the closed curve, then it would have to be in the plane curve, no?

Subject: Detect if a point is inside of a cone or not, in 3D space

From: Gustavo Morales

Date: 28 Apr, 2009 05:00:18

Message: 7 of 11

Matt Fig:

Hi ! (excuse for my english...)
> You said: That would depend on the projection. If by projection it is mean that a line is drawn from the point of the directrix through the point in question and through the plane containing the closed curve, then it would have to be in the plane curve, no?

> Roger said: the problem can be reduced to projecting the given point onto a point in the plane of the directrix and determining whether the projected point lies inside that directrix.

> Gustavo says: I understand you not so well Matt....
"..from the point of the directrix..": What point? directrix is a curve and has infinite points. Are you meaning "the vertex"?.

And I don't know projections from a point to a point.

And... remember the directrix is just one curve, not infinit curves. The conic surface is generated by moving a straight line fixed at a point (vertex) over a fixed curve (directrix). Vertex and Directrix are not coplanars.

Besides, I suppose that (because Roger is omitting the type of projection) he's talking about an "orthogonal projection" of a point onto a plane. In thaaat general case, I have to say it, there will be external points which projections lies inside the area enclosed by directrix curve and there will be internal points which projections lies outside that area.

Somebody can tell me why my suggestion to Paulo is not the simpler way to do it in a general case: cone equation = f(x,y,z) = 0 ?

Subject: Detect if a point is inside of a cone or not, in 3D space

From: Roger Stafford

Date: 28 Apr, 2009 05:11:02

Message: 8 of 11

"Gustavo Morales" <gustavo.morales.2000@gmail.com> wrote in message <gt5vd5$l42$1@fred.mathworks.com>...
> By other hand, I'm afraid I'm not agree with you Roger, because there's points outside the cone (circular or not) whose proyection in the directrix plane lies inside the area enclosed by the directrix. I'd like to show you in a drawing... but...

  Yes, I agree with Matt; it depends on what you mean by "projection". What I meant was that you draw a straight line in one direction starting from the vertex of the cone through the point to be tested. If you intersect the plane of the directrix, that intersection point is to be tested for being inside or outside the directrix curve. Otherwise, if the plane is never encountered, the point is certainly outside. There is another definition of a cone that includes both branches of the cone extending infinitely far on either side of the vertex from the directrix. In this definition the above projection line through a point is extended both directions from the vertex. If one of these directions intersects the plane of the directrix curve and inside the curve, then the point is inside this extended cone; otherwise it is outside.

Roger Stafford

Subject: Detect if a point is inside of a cone or not, in 3D space

From: Roger Stafford

Date: 28 Apr, 2009 05:27:01

Message: 9 of 11

"Gustavo Morales" <gustavo.morales.2000@gmail.com> wrote in message <gt62h2$fef$1@fred.mathworks.com>...
> Besides, I suppose that (because Roger is omitting the type of projection) he's talking about an "orthogonal projection" of a point onto a plane. In thaaat general case, I have to say it, there will be external points which projections lies inside the area enclosed by directrix curve and there will be internal points which projections lies outside that area.

  No, Gustavo, I am NOT referring to an orthogonal projection onto the plane of the directrix! As I said before, it is a projection from the cone's vertex through the point to be tested and intersecting the plane of the directrix curve if possible. If the intersection point lies inside the directrix curve, then the tested point lies inside the cone. If it lies outside the curve or if the one-directional projection never intersects the directrix plane, then the tested point lies outside. That seems to me to be a very clear concept. I don't see the point of all this arguing about definitions.

Roger Stafford

Subject: Detect if a point is inside of a cone or not, in 3D space

From: Gustavo Morales

Date: 28 Apr, 2009 05:49:01

Message: 10 of 11

Roger Stafford

> > By other hand, I'm afraid I'm not agree with you Roger, because there's points outside the cone (circular or not) whose proyection in the directrix plane lies inside the area enclosed by the directrix. I'd like to show you in a drawing... but...
>
> Yes, I agree with Matt; it depends on what you mean by "projection". What I meant was that you draw a straight line in one direction starting from the vertex of the cone through the point to be tested. If you intersect the plane of the directrix, that intersection point is to be tested for being inside or outside the directrix curve. Otherwise, if the plane is never encountered, the point is certainly outside. There is another definition of a cone that includes both branches of the cone extending infinitely far on either side of the vertex from the directrix. In this definition the above projection line through a point is extended both directions from the vertex. If one of these directions intersects the plane of the directrix curve and inside the curve, then the point is inside this extended cone; otherwise it is outside.
>
> Roger Stafford

The cone mathematic definition is one. Same for projection (is oblique or orthogonal)!. The cone (mathematically) always has two folds, certainly.

And what are you saying now is different: draw a straight line from vertex to test point. Now that's correct!
If this line (or its prolongation, which is not a projection, ..maybe an oblique one) intersects the directrix plane inside the directrix, your proposal is right!

But, if you do it in that way, you'll have to verify if intersection point is inside or not the directrix (what you're going to do know?: "The directrix divides the plane in 3 regions... and so on...").... So....I prefer directly verify if the point is inside the cone looking at the sign of f(xo,yo,zo)

I'm going to sleep... Thanks.. I've learned a lot in this blog

Subject: Detect if a point is inside of a cone or not, in 3D space

From: Gustavo Morales

Date: 28 Apr, 2009 10:19:01

Message: 11 of 11

Hi Roger! (again :-s)

I just want to tell you I'm going to need some help, from you and the community. I'm learning about Matlab, Mathematics, Programming, including English... So I have to appreciate your help and patient... Sorry if I was insistent... Maybe it happens when I'm getting sleepy.. I just was looking for the truth and the best solution.. This kind of solution all of you always offers here :)

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us