A rotation detector comprising: a rotating unit; a magnet disposed on the rotating unit; an angle detecting unit configured to detect a change in angle of rotation of the rotating unit by detecting a leakage magnetic field from the magnet; and at least one position detecting unit (20A, 20B) configured to operate when the magnet reaches a predetermined position, wherein the magnet has two end surfaces that are away from a rotation axis of the rotating unit and are oriented in a rotating direction and are magnetized to different magnetic poles, and has a flat surface parallel to a rotation plane including a rotation path of the rotating unit, wherein the angle detecting unit is disposed away from a revolution path of the magnet in a radial direction of the revolution path, the angle detecting unit includes a magnetoresistive element (Rc1, Rc2, Rs1, Rs2) including a free magnetic layer, a direction in which magnetization of the free magnetic layer changes is set so as to be parallel to the rotation plane, and the magnetoresistive element included in the angle detecting unit is operable to detect a change in angle of rotation of the rotating unit, and wherein the at least one position detecting unit is disposed away from the flat surface of the magnet in a direction parallel to the rotation axis of the rotating unit and includes a magnetoresistive element (Rx) and a switch circuit, the magnetoresistive element included in the position detecting unit has a resistance that depends on a change in intensity of a magnetic field component parallel to a direction of a tangent to the revolution path, the magnetic field component is included in a leakage magnetic field in the vicinity of the flat surface of the magnet, and the switch circuit is configured to produce a switch output based on a change in the resistance. a rotating unit; a magnet disposed on the rotating unit; an angle detecting unit configured to detect a change in angle of rotation of the rotating unit by detecting a leakage magnetic field from the magnet; and at least one position detecting unit (20A, 20B) configured to operate when the magnet reaches a predetermined position, wherein the magnet has two end surfaces that are away from a rotation axis of the rotating unit and are oriented in a rotating direction and are magnetized to different magnetic poles, and has a flat surface parallel to a rotation plane including a rotation path of the rotating unit, wherein the angle detecting unit is disposed away from a revolution path of the magnet in a radial direction of the revolution path, the angle detecting unit includes a magnetoresistive element (Rc1, Rc2, Rs1, Rs2) including a free magnetic layer, a direction in which magnetization of the free magnetic layer changes is set so as to be parallel to the rotation plane, and the magnetoresistive element included in the angle detecting unit is operable to detect a change in angle of rotation of the rotating unit, and wherein the at least one position detecting unit is disposed away from the flat surface of the magnet in a direction parallel to the rotation axis of the rotating unit and includes a magnetoresistive element (Rx) and a switch circuit, the magnetoresistive element included in the position detecting unit has a resistance that depends on a change in intensity of a magnetic field component parallel to a direction of a tangent to the revolution path, the magnetic field component is included in a leakage magnetic field in the vicinity of the flat surface of the magnet, and the switch circuit is configured to produce a switch output based on a change in the resistance.