im gone for a long weekend so plenty of time for anyone to answer.
if i have 4 points representing a polygon and each point is represented by an x and a y coordinate, is there an easy (or slightly less painfull) way to decide whether or not a point (a,b) lays within that polygon?
please note that this polygon DOES NOT take the shape of a square and has NO right angles and all side lengths are somewhat random.
the application:
say i wanted to draw a picture on the screen. i had the computer pick 8 random numbers (within screen limits) representing 4 random points. and now i want to fill in the area created by this polygon using point(x,y),z.
the polygon is convex in all situations. i also already know which points make up a side. for example, if there is point a, b, c, and d. I know a_b is a line, and b_c is a line, and c_d is a line and d_a is a line. i know which points are which so i can assume that point a has no relation to point c.
um.. yah, help?
if i have 4 points representing a polygon and each point is represented by an x and a y coordinate, is there an easy (or slightly less painfull) way to decide whether or not a point (a,b) lays within that polygon?
please note that this polygon DOES NOT take the shape of a square and has NO right angles and all side lengths are somewhat random.
the application:
say i wanted to draw a picture on the screen. i had the computer pick 8 random numbers (within screen limits) representing 4 random points. and now i want to fill in the area created by this polygon using point(x,y),z.
the polygon is convex in all situations. i also already know which points make up a side. for example, if there is point a, b, c, and d. I know a_b is a line, and b_c is a line, and c_d is a line and d_a is a line. i know which points are which so i can assume that point a has no relation to point c.
um.. yah, help?
Comment