An algorithm is presented which solves the problem of obtaining a rigorous helicoidal description of an irregular nucleic acid segment. Central to this approach is the definition of a function describing simultaneously the curvature of the nucleic acid segment in question and the corresponding stepwise variation of helicoidal parameters along the segment. Minimisation of this function leads to an optimal distribution of the conformational irregularity of the segment between these two components. Further, it is shown that this approach can be applied equally easily to single or double stranded nucleic acids. The results of this analysis yield both the absolute helicoidal parameters of individual bases/base pairs and the relative helicoidal parameters between successive bases/base pairs as well as the overall locus of the helical axis. The possibilities of this mathematical approach are demonstrated with the help of a computer program termed "Curves" which is applied to the study of a number of different nucleic acid structures.