Magnetic Needle In Non Uniform Magnetic Field