Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Challenge
Index -> Contests
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
bugzpodder




PostPosted: 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
Sponsor
Sponsor
Sponsor
sponsor
Asok




PostPosted: Sun Apr 06, 2003 10:24 pm   Post subject: (No subject)

no thanks Wink

lol Razz

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


*ZAP*
Tony




PostPosted: Sun Apr 06, 2003 10:31 pm   Post subject: (No 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
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
bugzpodder




PostPosted: Mon Apr 07, 2003 7:00 am   Post subject: (No 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.
Display posts from previous:   
   Index -> Contests
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: