  Zernike polynomials are widely used to describe the wavefront phase as they
are well suited to the circular geometry of various optical apertures.
Non-conventional optical systems, such as future large optical telescopes with
highly segmented primary mirrors or advanced wavefront control devices using
segmented mirror membrane facesheets, use approximate numerical methods to
reproduce a set of Zernike or hexagonal modes with the limited degree of
freedom offered by hexagonal segments. In this paper, we present a novel
approach for a rigorous Zernike and hexagonal modes decomposition adapted to
hexagonal segmented pupils by means of analytical calculations. By contrast to
numerical approaches that are dependent on the sampling of the segment, the
decomposition expressed analytically only relies on the number and positions of
segments comprising the pupil. Our analytical method allows extremely quick
results minimizing computational and memory costs. Further, the proposed
formulae can be applied independently from the geometrical architecture of
segmented optical apertures. Consequently, the method is universal and
versatile per se. This work has many potential applications in particular for
modern astronomy with extremely large telescopes.
