Python and Turtle Algorithms,Difficulty Level 7,games,math,python Triangle Orientation with Python Turtle

Triangle Orientation with Python Turtle

Given three ordered points (red, green, blue) of a triangle, the orientation of the triangle is clockwise if a right turn happens from the first line (red to green) to the second line (green to blue). Similarly the orientation of the triangle is counterclockwise if a left turn happens from the first line (red to green) to the second line (green to blue).

Draw many random triangles and color triangle in yellow if the triangle is clockwise, color triangle in cyan if the triangle is counterclockwise.

Triangle Orientation with Python Turtle

What’s next?
Random Intersecting Lines with Python Turtle
Two Randomly Moving Intersecting Lines

Related Post