A method is provided for determining a relative position of an object in relation to an x-ray imaging apparatus for creating an x-ray and a recorded image. The method includes brining an object in a ray path of the x-ray into a first position. The x-ray is created with a first focus point by an x-ray source and a first recorded image of the object in the first position is created by the x-ray focused on a first focus point. In the first recorded image, at least one defined geometry in and/or on the object is imaged. A measure for a change in the focus point towards a second focus point is undertaken at the x-ray source. The x-ray with the second focus point is created by the x-ray source and a second recorded image of the object in the first position is created by the x-ray focused on the second focus point. In the second recorded image, the at least one defined geometry is imaged. A distance from the object to the x-ray source and/or to the x-ray detector is determined based on the change in the focus point, as well as on the basis of the imagings of the at least one defined geometry in the first and the second recorded image.