debugg COMShift
This commit is contained in:
@@ -106,9 +106,11 @@ class System(Body):
|
|||||||
return coord
|
return coord
|
||||||
|
|
||||||
def COMShift(self): #Shift coordinates of bodies in system to COM frame and set COM at rest
|
def COMShift(self): #Shift coordinates of bodies in system to COM frame and set COM at rest
|
||||||
|
COM = self.COM
|
||||||
|
COMV = self.COMV
|
||||||
for body in self.bodylist:
|
for body in self.bodylist:
|
||||||
body.q = body.q - self.COM
|
body.q = body.q - COM
|
||||||
body.v = body.v - self.COMV
|
body.v = body.v - COMV
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def LCOM(self): #return angular momentum of the center of mass
|
def LCOM(self): #return angular momentum of the center of mass
|
||||||
|
|||||||
Reference in New Issue
Block a user