Computer Science Canada

Challenge

Author:  bugzpodder [ Sun Apr 06, 2003 10:22 pm ]
Post subject:  Challenge

discuss the theory behind a program that takes a point P and a set of vertices of a polygon (not necessary convex) and list all the edges such that it is possible to draw a ray from P in which the ray intersects that particular edge before intersecting any other edges

Author:  Asok [ Sun Apr 06, 2003 10:24 pm ]
Post subject: 

no thanks Wink

lol Razz

speaking of rays... *takes out a ray gun*


*ZAP*

Author:  Tony [ Sun Apr 06, 2003 10:31 pm ]
Post subject: 

well I suppose we can just draw that polygon onto a vertual screen (2D array)... we all know how to draw a line between two points, right?

then for every point of polygon, draw a ray and see if that ray intersects another edge...

there got to be an easier way of doing it though Confused

Author:  bugzpodder [ Mon Apr 07, 2003 7:00 am ]
Post subject: 

right now i have a method. connect the point to all midpoints of edges and check for intersections before that intersection. if none that edge is ok. now i we need to take care of all those midpoints that are hidden by a concave part:
midpoint
|
----
> <
.
then connect the point to all the vertices edges, extend a little bit and check if yyou are still on the same side of the polygon. if you are, intersect all the edge and find the closest intersection and add that edge to the output.


: