Computer Science Canada Programming C, C++, Java, PHP, Ruby, Turing, VB   Username:   Password: Wiki   Blog   Search   Turing   Chat Room  Members
Challenge
Author Message
bugzpodder

Posted: 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

Asok

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

no thanks

lol

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

*ZAP*
Tony

Posted: 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
Tony's programming blog. DWITE - a programming contest.
bugzpodder

Posted: 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: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First

Page 1 of 1  [ 4 Posts ]
 Jump to:  Select a forum  CompSci.ca ------------ - Network News - General Discussion     General Forums   -----------------   - Hello World   - Featured Poll   - Contests     Contest Forums   -----------------   - DWITE   - [FP] Contest 2006/2008   - [FP] 2005/2006 Archive   - [FP] 2004/2005 Archive   - Off Topic     Lounges   ---------   - User Lounge   - VIP Lounge     Programming -------------- - General Programming     General Programming Forums   --------------------------------   - Functional Programming   - Logical Programming   - C     C   --   - C Help   - C Tutorials   - C Submissions   - C++     C++   ----   - C++ Help   - C++ Tutorials   - C++ Submissions   - Java     Java   -----   - Java Help   - Java Tutorials   - Java Submissions   - Ruby     Ruby   -----   - Ruby Help   - Ruby Tutorials   - Ruby Submissions   - Turing     Turing   --------   - Turing Help   - Turing Tutorials   - Turing Submissions   - PHP     PHP   ----   - PHP Help   - PHP Tutorials   - PHP Submissions   - Python     Python   --------   - Python Help   - Python Tutorials   - Python Submissions   - Visual Basic and Other Basics     VB   ---   - Visual Basic Help   - Visual Basic Tutorials   - Visual Basic Submissions     Education ----------- - Student Life   Graphics and Design ----------------------- - Web Design     Web Design Forums   ---------------------   - (X)HTML Help   - (X)HTML Tutorials   - Flash MX Help   - Flash MX Tutorials   - Graphics     Graphics Forums   ------------------   - Photoshop Tutorials   - The Showroom   - 2D Graphics   - 3D Graphics     Teams ------ - dTeam Public

 Style: Appalachia blueSilver eMJay subAppalachia subBlue subCanvas subEmjay subGrey subSilver subVereor Search: