This is my code, it draws a triangle using turtle, and then generate 300 random dots, my question is how do i make the dots that land INSIDE the triangle change color for example blue and the dots outside the triangle remain black? could someone add onto my code please? Thanks in advance.
from turtle import *
from random import randint
speed("fastest")
area_size = 800
max_coord = area_size / 2
num_dots = 300
setup(area_size, area_size)
penup()
goto(-200, -200)
pendown()
goto(200, -200)
goto(200, 200)
goto(-200,-200)
for _ in range(num_dots):
dots_pos_x = randint(-max_coord, max_coord)
dots_pos_y = randint(-max_coord, max_coord)
penup()
goto(dots_pos_x, dots_pos_y)
dot(7)
pendown()
hideturtle()
done()