A novel method mapping the DNA or RNA sequence into a folding curve in three dimensional space, the Z curve, has been proposed based on the symmetry of the regular tetrahedrons. There exists a unique Z curve for a given DNA sequence, on the contrary, the DNA sequence can be uniquely determined by the given Z curve. The properties of the Z curves have been studied in great details. The symmetry, the periodicity, the local motif, and the global feather of the distribution of bases of the DNA sequences are reflected by the rich folding structures of the Z curves. The Z curves may be smoothed by the B-spline functions of different orders. Therefore, the Z curves may have any resolution by choosing the suitable spline functions. The higher the order of the B-spline function chosen, the lower the resolution of the Z curve. So, the Z curves are suitable for visualizing and analyzing the DNA sequences with any length. The study of the Z curves develops further a new area to visualizing and analyzing the DNA sequences by a geometrical approach. The method of the Z curves may be strengthened by using the ripe mathematical tools of geometry on the one hand; and by using the powerful technique of the computer graphics on the other hand.