apply to vector component
This commit is contained in:
parent
fa697af573
commit
b212bb2676
|
@ -48,6 +48,10 @@ class Vector(list):
|
|||
self.y *= other
|
||||
return self
|
||||
|
||||
def apply_to_components(self, function):
|
||||
self.x = function(self.x)
|
||||
self.y = function(self.y)
|
||||
|
||||
def place(self, x=None, y=None):
|
||||
if x is not None:
|
||||
self.x = x
|
||||
|
|
Loading…
Reference in New Issue