From 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 Mon Sep 17 00:00:00 2001 From: Joe Hunkeler Date: Tue, 11 Aug 2015 16:51:37 -0400 Subject: Repatch (from linux) of OSX IRAF --- sys/gio/gcurpos.x | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 sys/gio/gcurpos.x (limited to 'sys/gio/gcurpos.x') 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 +include + +# 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 -- cgit