According to Ampere's Law the flow of charge generates loops of magnetic field.
But what would happen if this wire was placed in the magnetic field of some other source?
The two magnetic fields would interact with each other. When two fields inteact with each otehr they push and pull the field sources. Like when two permanent magnets push apart from each other or are attracted to each other. This magnetic force can be calculated.
Fmagnetic= force of attraction or repulsion. Measured in Newtons [N.]
B = strength of the external magnetic field. Measured in Tesla's [T.]
I = current in the wire. Measured in Amps [A.]
L = length of the wire that is in themagnetic field. Measured in meters [m.]
θ = acute angle between the current and b-field's directions.
("Acute" means less than 90°.)
This equation yields the magnitude of the magnetic force. It does not determine the direction. The direction is determined by the "open right hand rule."