diff options
author | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
---|---|---|
committer | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
commit | 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch) | |
tree | 4464880c571602d54f6ae114729bf62a89518057 /sys/gio/gcurpos.x | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'sys/gio/gcurpos.x')
-rw-r--r-- | sys/gio/gcurpos.x | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/sys/gio/gcurpos.x b/sys/gio/gcurpos.x new file mode 100644 index 00000000..a0d4cb4d --- /dev/null +++ b/sys/gio/gcurpos.x @@ -0,0 +1,41 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include <gki.h> +include <gio.h> + +# GCURPOS -- Get the current position in world coordinates. The current +# position is maintained internally in GKI coordinates to make it invariant +# with respect to changes in the current WCS. + +procedure gcurpos (gp, x, y) + +pointer gp # graphics descriptor +real x, y # current position in current WCS (output) + +real aelogr() +include "gpl.com" + +begin + if (gp != gp_out || GP_WCS(gp) != wcs) + call gpl_cache (gp) + + if (IS_INDEF(cx) || IS_INDEF(cy)) { + x = INDEF + y = INDEF + + } else { + x = (cx - mxorigin) / xscale + wxorigin + if (xtran != LINEAR) + if (xtran == LOG) + x = 10.0 ** x + else + x = aelogr (x) + + y = (cy - myorigin) / yscale + wyorigin + if (ytran != LINEAR) + if (ytran == LOG) + y = 10.0 ** y + else + y = aelogr (y) + } +end |