comparison python/moving.py @ 690:463150a8e129 dev

minor updates
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Mon, 29 Jun 2015 15:47:30 -0400
parents f2b52355a286
children e14e2101a5a9
comparison
equal deleted inserted replaced
689:9990ef119bce 690:463150a8e129
196 elif i == 1: 196 elif i == 1:
197 return self.y 197 return self.y
198 else: 198 else:
199 raise IndexError() 199 raise IndexError()
200 200
201 def orthogonal(self): 201 def orthogonal(self, clockwise = True):
202 return Point(self.y, -self.x) 202 'Returns the orthogonal vector'
203 if clockwise:
204 return Point(self.y, -self.x)
205 else:
206 return Point(-self.y, self.x)
203 207
204 def multiply(self, alpha): 208 def multiply(self, alpha):
205 'Warning, returns a new Point' 209 'Warning, returns a new Point'
206 return Point(self.x*alpha, self.y*alpha) 210 return Point(self.x*alpha, self.y*alpha)
207 211