The analysis of protein structure using secondary structure line segments has been widely used in many structure analysis and prediction methods over the past 20 years. Its use in methods that compare protein structures at this level of representation is becoming more important as an increasing number of protein structures become determined through structural genomic programmes. The standard method used to define line segments is to fit an axis through each secondary structure element. This approach has difficulties, however, both with inconsistent definitions of secondary structure and the problem of fitting a single straight line to a bent structure. The procedure described here avoids these problems by finding a set of line segments independently of any external secondary structure definition. This allows the segments to be used as a novel basis for secondary structure definition by taking the average rise/residue along each axis to characterise the segment. This practice has the advantage that secondary structures are described by a single (continuous) value that is not restricted to the conventional classes of alpha-helix, 310 and beta-strand. This latter property allows structures without "classic" secondary structures to be encoded as line segments that can be used in comparison algorithms. When compared over a large number of pairs of homologous proteins, the current method was found to be slightly more consistent than a widely used method based on hydrogen bonds.