Program
Listing:
Program
Lines:
D01
LBL
D
D02
INPUT
M
D03
INPUT
N
D04
INPUT
T
D05
GTO
D
Bytes and Checksum:
N01
LBL
N
N02
INPUT
X
N03
INPUT
Y
N04
RCL
X
N05
RCL
N
N06
RCL
M
N07
CMPLX-
N08
RCL
T
N09
+/-
N10
1
Nil
B,r+y,x
N12
CMPLXx
N13
STO
U
N14
xOy
N15
STO
V
N16
xOy
N17
VIEW
U
N18
VIEW
V
N19
GTO
N
Bytes and Checksum:
Description:
This
routine
defines
the
new
coordinate
system.
Prompts for and stores M, the new origin's
x-coordinate.
Prompts for and stores N, the new origin's
y-coordinate.
Prompts for and stores T, the angle 0.
Loops for review of inputs.
007.5,
1CD9
This routine converts from the old system to
the
new
system.
Prompts for and stores X, the old
in
coordinate.
Prompts for and stores
Y,
the old y-
coordinate.
Pushes Yup and recalls X to the
X-register.
Pushes X and Y up and recalls N to the
X-
register.
Pushes N, X,
and
Y up
and
recalls M.
Calculates
(X-M)
and
(Y-N).
Pushes
(X—M)
and
(Y—N)
up
and
recalls T.
Changes the sign of T because
sin(—T)
equals —sin(T).
Sets radius to 1 for computation of cos(T)
and
—sin(T).
Calculates cos(T)
and
-sin(T)
in X-
and
Y-
registers.
Calculates
(X-M)
cos(T) +
(X~N)
sin(T)
and
(Y-N)cos(T) -
(X-M)
sin(T).
Stores
x-coordinate
in
variable
U.
Swaps positions of the coordinates.
Stores y-coordinate in variable V.
Swaps positions of coordinates back.
Halts program to display U.
Halts program to display V.
Goes
back
for
another
calculation.
028.5,
6078
12:
Mathematics
Programs
199