Cody Bable

Generation

generate functionFri, 28 Apr 2023

create a function to copy turtle coordinates from user mouse clicks on the screen

def get_coordinates(distance, angle): # get x,y coordinates from distance and angle x = distance * math.cos(angle * math.pi / 180.0) y = distance * math.sin(angle * math.pi / 180.0) return (x, y) click1 = get_coordinates(distance_from_center, degrees_from_north) click2 = get_coordinates(distance_from_center, degrees_from_north)

Questions about programming?Chat with your personal AI assistant