Python and Turtle Algorithms,Difficulty Level 9,games,math,python,random Detecting a Point in a Polygon with Python Turtle

Detecting a Point in a Polygon with Python Turtle

Generate a random polygon with many sides and randomly drop point on the screen. If the point falls inside the polygon color it in red, otherwise color it in blue.

You can use Ray Casting Algorithm to determine if a point is inside a polygon. You may also want to know how to detect if two lines intersect with these two projects: Random Intersecting Lines and Two Randomly Moving Intersecting Lines.

Related Post