To help me better understand lambda I wrote this short snippet that rotates and transforms a quad (I hope I got the math right). Now, I want to replace the three steps below with one liner lambdas, possibly in conjunction with map().
Im using a vector class but hopefully, the functions are clear as to what they do.
self.orientation = vector(1,0)
self.orientation.rotate(90.0)
#the four corners of a quad
points = (vector(-1,-1),vector(1,-1),vector(1,1),vector(-1,1))
print points
#apply rotation to points according to orientation
rot_points = []
for i in points:
rot_points.append(i.rotated(self.orientation.get_angle()))
print rot_points
#transform the point according to world position and scale
real_points = []
for i in rot_points:
real_points.append(self.pos+i*self.scale)
print real_points
return real_points