aboutsummaryrefslogtreecommitdiff
path: root/sys/mwcs/gen/mwc1tranr.x
diff options
context:
space:
mode:
Diffstat (limited to 'sys/mwcs/gen/mwc1tranr.x')
-rw-r--r--sys/mwcs/gen/mwc1tranr.x24
1 files changed, 24 insertions, 0 deletions
diff --git a/sys/mwcs/gen/mwc1tranr.x b/sys/mwcs/gen/mwc1tranr.x
new file mode 100644
index 00000000..06ad0bf7
--- /dev/null
+++ b/sys/mwcs/gen/mwc1tranr.x
@@ -0,0 +1,24 @@
+include "../mwcs.h"
+
+# MW_C1TRAN -- Optimized 1D coordinate transformation.
+
+real procedure mw_c1tranr (a_ct, x)
+
+pointer a_ct #I pointer to CTRAN descriptor
+real x #I coordinates in input system
+
+real y
+pointer ct
+
+begin
+ # Get real or double version of descriptor.
+ ct = CT_R(a_ct)
+
+ # Perform the transformation; LNR is a simple linear transformation.
+ if (CT_TYPE(ct) == LNR) {
+ return (Memr[CT_LTM(ct)] * x + Memr[CT_LTV(ct)])
+ } else {
+ call mw_ctranr (a_ct, x, y, 1)
+ return (y)
+ }
+end