A vector magnet is designed and assembled with two electromagnets to produce a rotational magnetic field in any direction within a plane. This design allows a rotation of the magnetic field without a mechanical rotation of the magnets. The fast speed of the field rotation (~10 s for a complete 360° rotation) and the stability against mechanical vibration easily overcome the slow drifting effect in anisotropic magnetoresistance (AMR) and rotational magneto-optic Kerr effect (ROTMOKE) measurements. As an example we applied this vector magnet to carry out AMR and ROTMOKE measurements on epitaxial growth of Fe(10 nm)∕MgO(001) films. The result demonstrates the stability and high quality of the vector magnet in determining the magnetic anisotropy of magnetic thin films using AMR and ROTMOKE techniques.