A data processing method for determining control data for controlling beam positions which beam positions describe positions which a treatment beam has or would have if emitted by a beam source, the beam positions being represented by positions of the line passing through the centre of the treatment beam and being aligned with the direction of the treatment beam, the treatment beam being for treating a treatment body part of a patient, said method constituted to be performed by a computer and comprising the steps of: • providing treatment data which comprise data on a position of the treatment body part; • providing condition data which describe: constraints on the beam positions and/or constraints on positional changes of the beam positions, wherein said constraints allow for at least a part of the beam positions to lie not in a common plane; • providing an arrangement of the beam positions on the basis of the treatment data which arrangement fulfils the condition data; • determining control data for controlling a change of a relative position between the beam source and the treatment body part for changing the beam positions and for controlling an emission of the treatment beam from the beam source, the determined control data being constituted to change the beam positions (40, 42, 44, 46, 48) to follow the provided arrangement of the beam positions (41, 43, 45, 47, 49, 60 to 70) and to cause continuous emission of the treatment beam during a continuous change of the beam positions while the beam positions follow at least a part of the arrangement, characterised in that the condition data include a condition according to which the arrangement is determined such that lines representing the treatment beam at the beam positions are arranged such that they lie in a virtual curved surface and such that following the arrangement results in a continuous undulating relative movement between the beam source and the treatment body part such that the beam source moves at least partly around the treatment body part and according to which the beam source continuously emits the treatment beam during at least one or more parts of the continuous undulating relative movement, the continuous undulating relative movement comprising and being caused by a forward movement in a first degree of freedom about a first axis as well as, during the forward movement in the first degree of freedom, a forward and backward movement in a second degree of freedom about a second axis. • providing treatment data which comprise data on a position of the treatment body part; • providing condition data which describe: constraints on the beam positions and/or constraints on positional changes of the beam positions, wherein said constraints allow for at least a part of the beam positions to lie not in a common plane; • providing an arrangement of the beam positions on the basis of the treatment data which arrangement fulfils the condition data; • determining control data for controlling a change of a relative position between the beam source and the treatment body part for changing the beam positions and for controlling an emission of the treatment beam from the beam source, the determined control data being constituted to change the beam positions (40, 42, 44, 46, 48) to follow the provided arrangement of the beam positions (41, 43, 45, 47, 49, 60 to 70) and to cause continuous emission of the treatment beam during a continuous change of the beam positions while the beam positions follow at least a part of the arrangement,