You are viewing a single comment's thread. Return to all comments →
class Points(object): def __init__(self, x, y, z): self.x,self.y,self.z = x,y,z def __sub__(self, no): vector = [d1 - d2 for d1,d2 in zip([self.x,self.y,self.z],[no.x,no.y,no.z])] return Points(*vector) def dot(self, no): sprod = sum([sp1*sp2 for sp1,sp2 in zip([self.x,self.y,self.z],[no.x,no.y,no.z])]) return(sprod) def cross(self, no): vprod = [(self.y*no.z)-(self.z*no.y),(self.z*no.x)-(self.x*no.z),(self.x*no.y)-(self.y*no.x)] return Points(*vprod)
Seems like cookies are disabled on this browser, please enable them to open this website
Class 2 - Find the Torsional Angle
You are viewing a single comment's thread. Return to all comments →