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
def _get_moveable_distance(self, target): remaining = target - self._location travellable = self._speed * self._updateDelay to_move = length_towards(travellable, remaining) return to_move
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)