from MyPoint import * from MyLine import * from math import sin, cos class MyBot: # LongDistance = 1 def __init__(self): self.loc = MyPoint() self.dir = 0 self.lookline = MyLine() def look(self): self.lookline.a.x = self.loc.x self.lookline.a.y = self.loc.y # self.lookline.b.y = self.lookline.a.y + sin((2*3.1415927*self.dir)/360)*LongDistance # self.lookline.b.x = self.lookline.a.x + cos((2*3.1415927*self.dir)/360)*LongDistance self.lookline.b.y = self.lookline.a.y + sin((2*3.1415927*self.dir)/360)*1000 self.lookline.b.x = self.lookline.a.x + cos((2*3.1415927*self.dir)/360)*1000 def printLookLine(self): print "(", self.lookline.a.x, ", ", self.lookline.a.y, "), (",self.lookline.b.x, ", ", self.lookline.b.y, ")"