def cartesianSolenoidModel(self, position): """ Compute field values of ideal solenoid given Cartesian co-ordinates. @param position: 3xN L{np.ndarray} of position co-ordinates. """ x, y, z = position r,phi = cartesianToPolar(x,y) Br,Bz = self.cylindricalSolenoidModel(r,phi,z) Bx,By = polarToCartesian(Br,phi) return np.vstack((Bx,By,Bz))
def checkPolarToCartesian(cartesian, polar): assert_almost_equal(transforms.polarToCartesian(*polar), cartesian)
def transformFunction(params): r, theta = params return np.vstack(transforms.polarToCartesian(r, theta))
def transformFunction(params): r,theta = params return np.vstack(transforms.polarToCartesian(r, theta))