Cone-Line Segment Intersection 2D

Posted by nophnoph on Stack Overflow See other posts from Stack Overflow or by nophnoph
Published on 2010-05-17T16:46:17Z Indexed on 2010/05/17 16:50 UTC
Read the original article Hit count: 184

Filed under:
|
|

Hi everyone, I would like to know is there any way to determine if a cone is intersecting with a (finite)line segment. The cone actually a circle located at P(x,y) with theta degree field of view and radius r. The simple visualization can be found here (sorry i can't post the picture here)

I'm trying to do it in C# but I don't have any idea how to that, so for now this is what I'm doing :

  1. Check if the line segment is intersecting with the circle
  2. If the line segment is intersecting with the circle then I check every single point in the line segment using a function I found here.

But I don't think this is the best way to do it. Does anyone have an idea?

For additional info, I need this function to make some kind of simple vision simulator.

Thanks in advance :)

© Stack Overflow or respective owner

Related posts about collision-detection

Related posts about geometry