Lines in a cubic Surface

In 1849 Salmon and Caley discovered that there are exactly 27 straight lines contained in a non-singular complex projective cubic in 3-space. Unfortunately it is not easy to show these in Euclidean 3-space, some of these lines may lie in the plane at infinity and most of these lines generally are complex. For example, the Fermat cubic specializes to the cubic

and while none of the lines are in the plane at infinity only 3 are real.

In 1856 in an attempt to clarify the Salmon-Caley result Ludwig Schlaefli gave a construction of 12 lines that would lie in a cubic. The resulting set of lines is now known as "Schlaefli's double 6." It is easy from these to find the remaining 15 lines. These lines can be chosen, with care, to be real. Hilbert included this construction in his popular book on geometry "Geometry and the Imagination" written with S. Cohn-Vossen in 1932. This book is presently available from the American Mathematical Society in English. While the method is nice in theory it may not be possible to actually find integer polynomial equations for the lines and the containing cubic surface in order to graph.

If you are willing to allow decimal coefficients I explain how to find the actual equations in the projective case in my paper Numerically generic Unions of Lines and one can easily specialize to real 3-space. The picture above is a cubic surface containing a double 6, note 6 of the lines are red and 6 are black, none of the red (or black) lines intersect other red (resp. black) lines but each red line intersects 5 of the black lines and conversely. These calculations and the picture where made using Mathematica.

The paper Numerical Calculation of H-bases for Positive Dimensional Varieties discusses lines in the cubic from an affine (non-projective) point of view.