# macros for chem; 1.1 (CWI) 87/03/31
# cr = 0.08 # radius of invis circle at ring vertices (see cr[vh])
# crh = 0.16; crw = 0.12 # ht & wid of invis ellipse around atoms at ring vertices
# dav = 0.015 # vertical shift up for atoms in atom macro
# atom(text, wid, ht, carbon position, crh, crw, dav)
C: ellipse invis ht $5 wid $6 at T.w + ($4,$7)
L: ellipse invis ht $5 wid $6 at T.w + (cwid/2,$7)
R: ellipse invis ht $5 wid $6 at T.e + (-cwid/2,$7)
# bond(length, angle in degrees, whatever)
line $3 by ($1) * sin(($2)/deg), ($1) * cos(($2)/deg)
# fancy bonds: r, theta, from/at
line $3 invis by ($1) * sin(($2)/deg), ($1) * cos(($2)/deg)
V1: last line.start; V2: last line.end; dx = V2.x-V1.x; dy = V2.y-V1.y
norm = sqrt(dx*dx + dy*dy)
line from V1 + (nx,ny) to V2 + (nx,ny)
line from V1 - (nx,ny) to V2 - (nx,ny)
line $3 invis by ($1) * sin(($2)/deg), ($1) * cos(($2)/deg)
V1: last line.start; V2: last line.end; dx = V2.x-V1.x; dy = V2.y-V1.y
norm = sqrt(dx*dx + dy*dy)
line from V1 + (nx,ny) to V2 + (nx,ny)
line from V1 - (nx,ny) to V2 - (nx,ny)
line $3 invis by ($1) * sin(($2)/deg), ($1) * cos(($2)/deg)
V1: last line.start; V2: last line.end; dx = V2.x-V1.x; dy = V2.y-V1.y
norm = sqrt(dx*dx + dy*dy)
line from XZ + (nx,ny) to XZ - (nx,ny)
line $3 invis by ($1) * sin(($2)/deg), ($1) * cos(($2)/deg)
V1: last line.start; V2: last line.end; dx = V2.x-V1.x; dy = V2.y-V1.y
ah = arrowht; aw = arrowwid; ahead = arrowhead
arrowht = sqrt(dx*dx + dy*dy)
arrowht = ah; arrowwid = aw; arrowhead = ahead