def get_destination(self, currentpos, direction, distance):
     Ec().check(direction, "int", "direction, getDestination, Dest()")
     Ec().check(distance, "int", "distance, getDestination, Dest()")
     Ec().check(currentpos, "list", "currentPos, getDestination, Dest()")
     direction = float(direction)
     delta_y = distance * math.cos(math.radians(direction))
     delta_x = distance * math.sin(math.radians(direction))
     new_x = currentpos[0] + delta_x
     new_y = currentpos[1] + delta_y
     return new_x, new_y
Exemple #2
0
 def __init__(self):
     Subject.__init__(self)
     self.penlist = ["", "white", "black", "red", "yellow", "blue"]
     self.turtle = turtle.Turtle()
     self.pen_up()
     self.check = Ec().check
     self.triangle_size = 1
 def __init__(self):
     self.graphics = GraphWin("graphics.py", 500, 500)
     self.x = 250
     self.y = 250
     self.penDown = False
     self.color = "blue"
     self.penlist = ["", "white", "black", "red", "yellow", "blue"]
     self.check = Ec().check
 def __init__(self):
     super().__init__(self)
     self.top = tkinter.Tk()
     self.myCanvas = tkinter.Canvas(self.top, bg="grey", height=500,
                                    width=500)
     self.color = "white"
     self.penDown = False
     self.x = 250
     self.y = 250
     self.penlist = ["", "white", "black", "red", "yellow", "blue"]
     self.check = Ec().check  # error checking class
 def __init__(self):
     self.penlist = ["", "white", "black", "red", "yellow", "blue"]
     self.turtle = turtle.Turtle()
     self.pen_up()
     self.check = Ec().check  # error checking class