gmx helixorient calculates the coordinates and direction of the average axis inside an alpha helix, and the direction/vectors of both the Cα and (optionally) a sidechain atom relative to the axis.
As input, you need to specify an index group with Cα atoms corresponding to an α-helix of continuous residues. Sidechain directions require a second index group of the same size, containing the heavy atom in each residue that should represent the sidechain.
Note that this program does not do any fitting of structures.
We need four Cα coordinates to define the local direction of the helix axis.
The tilt/rotation is calculated from Euler rotations, where we define the helix axis as the local x-axis, the residues/Cα vector as y, and the z-axis from their cross product. We use the Euler Y-Z-X rotation, meaning we first tilt the helix axis (1) around and (2) orthogonal to the residues vector, and finally apply the (3) rotation around it. For debugging or other purposes, we also write out the actual Euler rotation angles as theta[1-3].xvg