A sensor for sensing the position of an object includes a magnet and a magnetic flux sensor. The magnet has dimensions that include a length, a width and a height. The magnet is adapted to generate a flux field. The flux field has a magnitude of flux and a flux direction. The flux direction changes along at least one of the dimensions. The magnetic flux sensor is mounted adjacent the magnet. The magnet provides a rotating magnetic field vector. A method for magnetizing a magnet to create the rotating magnetic field vector is also disclosed.