Ejemplo n.º 1
0
 def delVelocity(self):
     """Set the velocity to the null vector."""
     self.setVelocity(Vector.null())
Ejemplo n.º 2
0
 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)])
Ejemplo n.º 3
0
 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)
Ejemplo n.º 4
0
from myabstract import Vector

v1 = Vector.random()
v2 = Vector.random()
v3 = Vector.null()

print(v1, v2, v3)

v3 -= v2
print(v1)
Ejemplo n.º 5
0
 def delAcceleration(self):
     """Set the acceleration to the null vector."""
     self.setAcceleration(Vector.null())