Sulfur is capable of forming chain polymers or rings of various lengths. With a valence of 2, no other kinds of atoms are required, although the chains require monovalent terminators at each end. In a gaseous state, the molecules can be quite irregular, but crystallized, tend to be more regular. The rings and chains are still puckered, and so are neither planar (unlike benzene) nor simple straight lines. Consequently the subroutines generating such molecules have to take three dimensional details into account.
/* molsu - generate coordinates of a sulfur ring */ void molsu(s,radsu) double s[][7], radsu; {int i; for (i=0; i<8; i++) { molsc(&s[i][0],&s[i][1],&s[i][2],i); s[i][3]=radsu; s[i][4]=30.0; s[i][5]=20.0; s[i][6]=15.0; }}
void molsc(x,y,z,p) double *x, *y, *z; int p; { double d, al, be, t; d=2.048; al=3.1415926/4.0; be=(107.9*3.1415926)/360.0; t=sin(be)/cos(al/2.0); *x=d*sin(be)*cos(p*al)/sin(al); *y=d*sin(be)*sin(p*al)/sin(al); *z=(p%2==0?1.0:-1.0)*(d/2.0)*sqrt(1.0-t); }