There are two types of magnetic "charges", called "poles". The two ends of a bar magnet are the two different types. Two like magnetic poles will repel each other while two unlike magnetic poles attract each other.
A magnetic field exerts a force on a moving electric charge. The magnitude of the magnetic force Fmag on charge q moving with velocity v due to magnetic field B is given by
Fmag = q v B sin
We can also write this in the notation of a "cross product" or a "vector product",
F = q v x B
The magnetic force on a wire of length l carrying current I in a magnetic field is given by
The magnetic field at a distance r from a long, straight wire carrying current I is given by
Two currents, traveling in the same direction attract each other. Two currents in opposite directions repel each other.
The magnetic field at the center of a loop of radius a carrying current I is given by
The magnetic field inside a long solenoid is given by
where I is the current through the solenoid and n = N/L is the number of coils N per length L of the solenoid.
A current loop of N turns of wire in a magnetic field will experience a torque equal to
(c) Doug Davis, 2003; all rights reserved