MCPcopy Create free account
hub / github.com/ActiveState/code / __sub__

Method __sub__

recipes/Python/502252_Physics/recipe-502252.py:40–42  ·  view source on GitHub ↗

Return the difference of vector subtraction.

(self, vector)

Source from the content-addressed store, hash-verified

38 return Vector(self.x + vector.x, self.y + vector.y)
39
40 def __sub__(self, vector):
41 'Return the difference of vector subtraction.'
42 return Vector(self.x - vector.x, self.y - vector.y)
43
44 def __mul__(self, number):
45 'Return the product of vector multiplication.'

Callers

nothing calls this directly

Calls 1

VectorClass · 0.70

Tested by

no test coverage detected