def __init__(self,rho=0,phi=0,z=0): """ Initializes the vector by default to 0,0,0 """ order = ["rho","phi","z"] values = {"rho":float(rho), "phi":float(phi), "z":float(z)} CoordinateVector.__init__(self,order,values)
def __init__(self,x=0,y=0,z=0): """ Initializes the vector by default to 0,0,0 """ order = ["x","y","z"] values = {"x":float(x), "y":float(y), "z":float(z)} CoordinateVector.__init__(self,order,values)
def __init__(self,r=0,phi=0,theta=0): """ Initializes the vector by default to 0,0,0 """ order = ["r","phi","theta"] values = {"r":float(r), "phi":float(phi), "theta":float(theta)} CoordinateVector.__init__(self,order,values)
def __init__(self, x=0, y=0, z=0): """ Initializes the vector by default to 0,0,0 """ order = ["x", "y", "z"] values = {"x": float(x), "y": float(y), "z": float(z)} CoordinateVector.__init__(self, order, values)
def __init__(self, rho=0, phi=0, z=0): """ Initializes the vector by default to 0,0,0 """ order = ["rho", "phi", "z"] values = {"rho": float(rho), "phi": float(phi), "z": float(z)} CoordinateVector.__init__(self, order, values)
def __init__(self, r=0, phi=0, theta=0): """ Initializes the vector by default to 0,0,0 """ order = ["r", "phi", "theta"] values = {"r": float(r), "phi": float(phi), "theta": float(theta)} CoordinateVector.__init__(self, order, values)
def __cross_product__(self, other): """ Defines the cross product in 3 dimensions. """ if isinstance(other, CoordinateVector): if len(other) != 3: raise CoordinateException( "Error: Attempting to do the cross product on a vector that is not 3 dimensions." ) values = {} values["x"] = self.y * other.z - self.z * other.y values["y"] = self.z * other.x - self.x * other.z values["z"] = self.x * other.y - self.y * other.x return CoordinateVector(self.order, values) raise CoordinateException( "Using the cross product for an unknown class.")