The diameter of an object can be established in different ways. If the center of the object is known, a single sensor is sufficient for the measurement whose result is evaluated with the position of the center point or the axis. If the position of the center point is not known, the diameter is measured directly using two sensors. The distance information here is also evaluated together. In particular cases, if the opaqueness of the object allows this, the determination of the diameter can also be made directly using a confocal sensor.