A method for controlling a heating apparatus according to the distance from it to an obstacle, the heating apparatus comprising heating means and a control module connected to means for detecting the power radiated by the heating means and to a distance detecting means, the control module being configured to compare the radiated power measured by the radiated power detecting means to a command of power to-be-emitted, and then to send a to-be-emitted power instruction to the heating means of the heating apparatus according to the comparison result, characterized in that the method comprises: - detecting, by the distance detecting means, all the obstacles present in the detecting field of the distance detecting means; - measuring, by the distance detecting means, the distance from the obstacle closest to the heating apparatus; - comparing the measured distance from the closest obstacle to a predefined safety threshold, and then: - if the measured distance from the closest obstacle is lower than or equal to said safety threshold, updating, by the control module, the to-be-emitted power instruction to a predefined safety to-be-emitted power instruction, and - if the measured distance from the closest obstacle is greater than said safety threshold: - determining whether at least one of the detected obstacles is a user; - if none of the detected obstacles is a user, maintaining, by the control module, the to-be-emitted power instruction; and - if at least one of the detected obstacles is a user, measuring, by the distance detecting means, the distance from the user closest to the heating apparatus; and - measuring the power radiated by the radiated power detecting means and updating, by the control module, the to-be-emitted power instruction according to the radiated power and the measured distance from the closest user, according to a first conversion law, such that the user closest to the heating apparatus receives, by radiation, a constant power corresponding to the to-be-emitted power command regardless of the distance thereof from the heating apparatus. - detecting, by the distance detecting means, all the obstacles present in the detecting field of the distance detecting means; - measuring, by the distance detecting means, the distance from the obstacle closest to the heating apparatus; - comparing the measured distance from the closest obstacle to a predefined safety threshold, and then: - if the measured distance from the closest obstacle is lower than or equal to said safety threshold, updating, by the control module, the to-be-emitted power instruction to a predefined safety to-be-emitted power instruction, and - if the measured distance from the closest obstacle is greater than said safety threshold: - determining whether at least one of the detected obstacles is a user; - if none of the detected obstacles is a user, maintaining, by the control module, the to-be-emitted power instruction; and - if at least one of the detected obstacles is a user, measuring, by the distance detecting means, the distance from the user closest to the heating apparatus; and - measuring the power radiated by the radiated power detecting means and updating, by the control module, the to-be-emitted power instruction according to the radiated power and the measured distance from the closest user, according to a first conversion law, such that the user closest to the heating apparatus receives, by radiation, a constant power corresponding to the to-be-emitted power command regardless of the distance thereof from the heating apparatus. - determining whether at least one of the detected obstacles is a user; - if none of the detected obstacles is a user, maintaining, by the control module, the to-be-emitted power instruction; and - if at least one of the detected obstacles is a user, measuring, by the distance detecting means, the distance from the user closest to the heating apparatus; and - measuring the power radiated by the radiated power detecting means and updating, by the control module, the to-be-emitted power instruction according to the radiated power and the measured distance from the closest user, according to a first conversion law, such that the user closest to the heating apparatus receives, by radiation, a constant power corresponding to the to-be-emitted power command regardless of the distance thereof from the heating apparatus.