#! python
import math
class point:
def __init__(self, xloc, yloc):
self.x = xloc
self.y = yloc
def rotateorigin(self, degrees):
radians = degrees * math.pi / 180.0
return point(self.x * math.cos(radians) - self.y * math.sin(radians),
self.x * math.sin(radians) + self.y * math.cos(radians))
def rotate(self, degrees, xorigin, yorigin):
rot = point(self.x - xorigin, self.y - yorigin).rotateorigin(degrees)
return point(rot.x + xorigin, rot.y + yorigin)
def translate(self, x, y):
return point(self.x + x, self.y + y)
class actor:
_width = 80
_depth = 48
def __init__(self, boyOrGirl, x, y, angle):
self._x = x
self._y = y
self._angle = angle
if boyOrGirl == "boy":
self._isGirl = False
self._class = "boy"
else:
self._isGirl = True
self._class = "girl"
def center(self):
return point(self._x, self._y)
def point(self, id):
return self.pointrel(id).rotateorigin(self._angle).translate(self._x, self._y)
def pointrel(self, id):
if id == "center":
return point(0, 0)
elif id == "L shoulder":
return point(self._width/2 - 2, -self._depth/2 + 2)
elif id == "R shoulder":
return point( - self._width/2 + 2, -self._depth/2 + 2)
elif id == "L hip":
return point(self._width/2 - 2, -self._depth/2 + 2)
elif id == "R hip":
return point( - self._width/2 + 2, -self._depth/2 + 2)
elif id == "L arm":
return point(self._width/2 - 2, 0)
elif id == "R arm":
return point( - self._width/2 + 2, 0)
elif id == "ribcage":
return point(0, - self._depth / 2 + 2)
elif id == "L outward":
return point(self._width, self._depth)
elif id == "R outward":
return point(- self._width, self._depth)
def armto(self, origid, dest):
orig = self.point(origid)
print '
$Id$
""" def startscene(title): print "