def delVelocity(self): """Set the velocity to the null vector.""" self.setVelocity(Vector.null())
def null(cls, n=3, d=2): """Return the neutral motion.""" # The dimension d still needs to be implemented for the vectors. return cls([Vector.null(d=d) for i in range(n)])
def __init__(self,position): """Create body using form and optional name.""" form=Form([Point(x,y) for (x,y) in [(0,1),(-1,-1),(1,-1)]]) motion=Motion(position,Vector.null(d=2),Vector.null(d=2)) moment=Motion.null(d=1,n=2) super().__init__(form,motion,moment)
from myabstract import Vector v1 = Vector.random() v2 = Vector.random() v3 = Vector.null() print(v1, v2, v3) v3 -= v2 print(v1)
def delAcceleration(self): """Set the acceleration to the null vector.""" self.setAcceleration(Vector.null())