and is the angle between them. If is in the same direction as then the dot product is positive and the gradient points "uphill" pulling the magnet into regions of higher -field (more strictly larger ). This equation is strictly only valid for magnets of zero size, but is often a good approximation for not too large magnets. The magnetic force on larger magnets is determined by dividing them into smaller regions each having their own then summing up the forces on each of these very small regions. Magnetic torque on permanent magnets If two like poles of two separate magnets are brought near each other, and one of the magnets is allowed to turn, it promptly rotates to align itself with the first. In this example, the magnetic field of the stationary magnet creates a magnetic torque on the magnet that is free to rotate. This magnetic torque tends to align a magnet's poles with the magnetic field lines. A compass, therefore, turns to align itself with Earth's magnetic field. In terms of the pole model, two equal and opposite magnetic charges experiencing the same also experience equal and opposite forces. Since these equal and opposite forces are in different locations, this produces a torque proportional to the distance (perpendicular to the force) between them. With the definition of as the pole strength times the distance between the poles, this leads to , where is a constant called the vacuum permeability, measuring V·s/(A·m) and is the angle between and . Mathematically, the torque on a small magnet is proportional both to the applied magnetic field and to the magnetic moment of the magnet: where × represents the vector cross product. This equation includes all of the qualitative information included above. There is no torque on a magnet if is in the same direction as the magnetic field, since the cross product is zero for two vectors that are in the same direction. Further, all other orientations feel a torque that twists them toward the direction of magnetic field. Interactions with electric currents Currents of electric charges both generate a magnetic field and feel a force due to magnetic B-fields. Magnetic field due to moving charges and electric currents All moving charged particles produce magnetic fields. Moving point charges, such as electrons, produce complicated but well known magnetic fields that depend on the charge, velocity, and acceleration of the particles.