aboutsummaryrefslogtreecommitdiff
path: root/sys/mwcs/gen/mwc1tranr.x
blob: 06ad0bf7b0104f119f003a78bd3ad87ad54491b9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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