A magnetoresistive element includes a meandering X-axis array that is constituted by X-axis segments alternately connected, and a meandering Y-axis array that is constituted by Y-axis segments alternately connected. When rotated 90°, the Y-axis array has the same layout as the X-axis array. Such a structure cancels the electrical resistance change due to the AMR effect, thus reducing the waveform distortion of output voltage.