  Atomic magnetometry is one of the most sensitive ways to measure magnetic
fields. We present a method for converting a naturally scalar atomic
magnetometer into a vector magnetometer by exploiting the polarization
dependence of hyperfine transitions in rubidium atoms. First, we fully
determine the polarization ellipse of an applied microwave field using a
self-calibrating method, i.e. a method in which the light-atom interaction
provides everything required to know the field in an orthogonal laboratory
frame. We then measure the direction of an applied static field using the
polarization ellipse as a three-dimensional reference defined by Maxwell's
equations. Although demonstrated with trapped atoms, this technique could be
applied to atomic vapors, or a variety of atom-like systems.
