예제 #1
0
 def other():
     """Perpedicular to the mid point"""
     v = mid - self.location
     ref = Vector(v.y, v.x) + self.location
     for i in xrange(-50, 50, 5):
         i /= 10
         v = length_towards(i, ref)
         there = self.location + v
         yield there
예제 #2
0
 def _get_moveable_distance(self, target):
     remaining = target - self._location
     travellable = self._speed * self._updateDelay
     to_move = length_towards(travellable, remaining)
     return to_move
예제 #3
0
 def in_line():
     for i in xrange(-50, 50, 5):
         i /= 10
         v = length_towards(i, mid)
         there = self.location + v
         yield there
 def test_length_beyond(self):
     exp = Vector(0, 8)
     actual = length_towards(8, self._a)
     actual = Vector(round(actual.x, 5), round(actual.y, 5))
     util.assertEqual(exp, actual)