Door, in particular a swing or revolving door, - having a door leaf, and - having a door sensor for installation on the door leaf in one of the following four installation situations: • on the outside of the door in the case of a left-rotating door, • on the inside of the door in the case of a left-rotating door, • on the outside of the door in the case of a right-rotating door, or • on the inside of the door in the case of a right-rotating door, wherein the door sensor is fitted on the door leaf of the door, wherein the door sensor has • a 3D image sensor - for monitoring a monitoring field (70, 71, 72) in front of the door leaf, • an at least 2-axis rotation angle encoder - for detecting the rotation angle of the door leaf, and • a common support - that connects the 3D image sensor to the rotation angle encoder, wherein - the common support defines an installation plane for installation on the door leaf, and the axes of the rotation angle encoder are arranged with an inclination in relation to the installation plane and are in particular arranged with an inclination of 15° and/or - the common support comprises an edge (33, 34) or marker for horizontally and/or vertically orienting the support on the door leaf, and the axes of the rotation angle encoder are arranged with an inclination in relation to the edge or marking and are in particular arranged with an inclination of 30°, characterized in that the door sensor is suitable for detecting a rotation around the axes of the rotation angle encoder and for ascertaining, from the rotations around the axes of the rotation angle encoder, the directions of rotation around the axes of the rotation angle encoder, and for ascertaining, from the directions of rotation, the relevant installation situation of the door sensor on the door. - having a door leaf, and - having a door sensor for installation on the door leaf in one of the following four installation situations: • on the outside of the door in the case of a left-rotating door, • on the inside of the door in the case of a left-rotating door, • on the outside of the door in the case of a right-rotating door, or • on the inside of the door in the case of a right-rotating door, • on the outside of the door in the case of a left-rotating door, • on the inside of the door in the case of a left-rotating door, • on the outside of the door in the case of a right-rotating door, or • on the inside of the door in the case of a right-rotating door, • a 3D image sensor - for monitoring a monitoring field (70, 71, 72) in front of the door leaf, - for monitoring a monitoring field (70, 71, 72) in front of the door leaf, • an at least 2-axis rotation angle encoder - for detecting the rotation angle of the door leaf, and - for detecting the rotation angle of the door leaf, and • a common support - that connects the 3D image sensor to the rotation angle encoder, - that connects the 3D image sensor to the rotation angle encoder, - the common support defines an installation plane for installation on the door leaf, and the axes of the rotation angle encoder are arranged with an inclination in relation to the installation plane and are in particular arranged with an inclination of 15° and/or - the common support comprises an edge (33, 34) or marker for horizontally and/or vertically orienting the support on the door leaf, and the axes of the rotation angle encoder are arranged with an inclination in relation to the edge or marking and are in particular arranged with an inclination of 30°,