Patent attributes
A magnetic sensor includes a first magnetoresistive element that detects a magnetic field along a first detection axis, a second magnetoresistive element that detects a magnetic field along a second detection axis inclining at an angle of 45 degrees with respect to the first detection axis, a first Hall element that detects a magnetic field along a third detection axis, and a second Hall element that detects a magnetic field along a fourth detection axis perpendicular to the third detection axis. This magnetic sensor has both characteristics of the Hall elements and characteristics of the magnetoresistive elements, and has high accuracy and a small size.