Exemplo n.º 1
0
    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))
Exemplo n.º 4
0
def checkPolarToCartesian(cartesian, polar):
    assert_almost_equal(transforms.polarToCartesian(*polar), cartesian)
Exemplo n.º 5
0
 def transformFunction(params):
     r,theta = params
     return np.vstack(transforms.polarToCartesian(r, theta))