Lines Matching +full:- +full:2 +full:g
16 printf "\ttextht = %g; textwid = .1; cwid = %g\n", textht, cwid
17 printf "\tlineht = %g; linewid = %g\n", lineht, linewid
34 dew = scale * 0.02 # east-west shift for left of/right of
48 $1 == "pic" { shiftfields(1); print; next } # pic pass-thru
60 $1 ~ /^[A-Z].*:$/ { # label; falls thru after shifting left
61 lastname = substr($1, 1, length($1)-1)
69 $1 ~ /^(double|triple|front|back)$/ && $2 == "bond" {
70 $1 = $1 $2; shiftfields(2); bond($1); next }
72 $1 == "aromatic" { temp = $1; $1 = $2; $2 = temp }
77 $1 ~ /^[A-Z]/ { molecule(); next }
79 $1 == "left" { left[++stack] = fields(2, NF); printf("Last: [\n"); next }
81 $1 == "right" { bracket(); stack--; next }
93 for (i = 2; i <= NF; i++)
96 NF = i - 1
101 for (cf = 2; cf <= NF; ) {
102 if ($cf ~ /(\+|-)?[0-9]+|up|down|right|left|ne|se|nw|sw/)
106 cf += 2
126 printf "Last: %s(%g, %g, %s)\n", type, leng, dir, from
141 if (n ~ /^\.[A-Z]/) # "from .V" => "from Last.V.s"
143 if (n ~ /^[A-Z][^.]*\.[A-Z][^.]*$/) # "from X.V" => "from X.V.s"
145 return fields(cf-1, NF)
150 if ($2 == ")")
154 printf("%s from last [].sw+(%g,0) to last [].sw to last [].nw to last [].nw+(%g,0)\n",
156 printf("%s from last [].se-(%g,0) to last [].se to last [].ne to last [].ne-(%g,0)\n",
171 gsub(/[^A-Za-z0-9]/, "", n) # for stuff like C(OH3): zap non-alnum
172 if ($2 == "")
175 else if ($2 == "below")
177 else if ($2 == "above")
179 else if ($2 == "left" && $3 == "of")
180 printf("Last: %s: %s with .e at %s.w+(%g,0)\n", n, $1, $4, dew)
181 else if ($2 == "right" && $3 == "of")
182 printf("Last: %s: %s with .w at %s.e-(%g,0)\n", n, $1, $4, dew)
192 if (substr(labtype[$2], 1, 1) != RING)
193 error(sprintf("%s is not a ring", $2))
195 v = substr(labtype[$2], 2, 1)
197 printf("\"\\s-3%d\\s0\" at 0.%d<%s.C,%s.V%d>\n", i, v+2, $2, $2, i)
203 if (type ~ /[1-8]$/)
213 for (cf = 2; cf <= NF; ) {
249 r = ringside / (2 * sin(pi/v))
252 a = ((i-1) / v * 360 + pt) / deg
253 printf "\tV%d: (%g,%g)\n", i, r * sin(a), r * cos(a)
264 printf("\tV%d: ellipse invis ht %g wid %g at V%d\n",
274 printf "\tline from V%d to V%d chop %g chop %g\n", i, j, c1, c2
289 printf "\tline from %g<C,V%d> to %g<C,V%d> chop %g chop %g\n",
292 printf "\tline from %g<C,V%d> to %g<C,V%d> chop %g chop %g\n",
293 2-rat, i, 2-rat, j, c1, c2
307 printf "\tline from %g<C,V%d> to %g<C,V%d>\n",
310 printf "\tline from %g<C,V%d> to %g<C,V%d>\n",
311 2-rat, i, 2-rat, j
322 printf "\tcircle rad %g at 0,0\n", r
333 gsub(/[^A-Za-z0-9]/, "", m)
341 if (substr(type, 3) == substr(last, 3)) # fails if not 6-sided
374 verts = substr(last, 2, 1)
376 return sprintf("V%d.%s", int(reduce(d-rd)/(360/verts)) + 1, corner(d))
390 for (cf++; $cf ~ /^[1-9]/; cf++) {
393 if (v2 == v1+1 || v1 == v && v2 == 1) # e.g., 2,3 or 5,1
395 else if (v1 == v2+1 || v2 == v && v1 == 1) # e.g., 3,2 or 1,5
405 if ($cf ~ /^[+\-]?[0-9]+/)
417 d -= 360
432 if (substr(s, i, 1) !~ /[A-Z]/) {
437 gsub(/([0-9]+\.[0-9]+)|([0-9]+)/, "\\s-3\\d&\\u\\s+3", s)
438 if (s ~ /([^0-9]\.)|(\.[^0-9])/) # centered dot
439 gsub(/\./, "\\v#-.3m#.\\v#.3m#", s)
440 return sprintf("atom(\"%s\", %g, %g, %g, %g, %g, %g)",
441 s, (n-nsub/2)*cwid, textht, (cloc-nsubc/2-0.5)*cwid, crh, crw, dav)
447 while ((n = match(s, /!?[A-Z][A-Za-z]*(([0-9]+\.[0-9]+)|([0-9]+))/)) > 0) {
448 os = os substr(s, 1, n-1) # prefix
451 s1 = substr(s1, 2)
453 gsub(/([0-9]+\.[0-9]+)|([0-9]+)/, "\\s-3\\d&\\u\\s+3", s1)
454 if (s1 ~ /([^0-9]\.)|(\.[^0-9])/) # centered dot
455 gsub(/\./, "\\v#-.3m#.\\v#.3m#", s1)
465 function shiftfields(n, i) { # move $n+1..$NF to $n..$NF-1, zap $NF
469 NF--
486 for (i = 1; i <= n; i += 2)
491 printf "chem\007: error on line %d: %s\n", lineno, s | "cat 1>&2"