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 checkCartesianToPolar(cartesian, polar):
    assert_almost_equal(transforms.cartesianToPolar(*cartesian), polar)
Exemplo n.º 3
0
def checkCartesianToPolar(cartesian, polar):
    assert_almost_equal(transforms.cartesianToPolar(*cartesian), polar)