diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
commit | fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch) | |
tree | bdda434976bc09c864f2e4fa6f16ba1952b1e555 /noao/onedspec/splot/fudgex.x | |
download | iraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz |
Initial commit
Diffstat (limited to 'noao/onedspec/splot/fudgex.x')
-rw-r--r-- | noao/onedspec/splot/fudgex.x | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/noao/onedspec/splot/fudgex.x b/noao/onedspec/splot/fudgex.x new file mode 100644 index 00000000..f1612b31 --- /dev/null +++ b/noao/onedspec/splot/fudgex.x @@ -0,0 +1,46 @@ +# FUDGEX -- Fudge an extended region marked by the cursor + +procedure fudgex (sh, gfd, x, y, n, wx1, wy1, xydraw) + +pointer sh +int gfd +real x[n] +real y[n] +int n +real wx1, wy1 +int xydraw + +char command[SZ_FNAME] +int i, i1, i2, wc, key +real slope +real wx2, wy2 + +int clgcur() +bool fp_equalr() + +begin + # Get second point + call printf ("x again:") + call flush (STDOUT) + i = clgcur ("cursor", wx2, wy2, wc, key, command, SZ_FNAME) + + # Fix order + call fixx (sh, wx1, wx2, wy1, wy2, i1, i2) + + if (xydraw == NO) { + wy1 = y[i1] + wy2 = y[i2] + } + if (fp_equalr (wx1, wx2)) + slope = 0. + else + slope = (wy2-wy1) / (wx2-wx1) + + # Replace pixels + do i = i1, i2 + y[i] = wy1 + (x[i] - wx1) * slope + + # Plot replaced pixels + i = i2 - i1 + 1 + call gpline (gfd, x[i1], y[i1], i) +end |