The Museum of HP Calculators


Ray Trace for the HP-41C/CV/CX

This program is Copyright © HP and is used here by permission. It was originally printed in the HP-67 Optics Solution Book. This program was entered and uploaded by Tony Duell.

This program is supplied without representation or warranty of any kind. Tony Duell, Hewlett Packard and The Museum of HP Calculators therefore assume no responsibility and shall have no liability, consequential or otherwise, of any kind arising from the use of this program material or any part thereof.

Documentation Information (CD or source code)
How to get this Program to your Calculator (via HP-IL, disk, wand, and fingers)
Download Binary (.raw) program for disk or PC HP-IL Card download
Download Hexadecimal (.dat) program for Serial Port download

Program Listing

LINE  KEYS
 01 LBL "RAYTRC"
 02 LBL 10
 03 LBL A
 04 RCL 20
 05 RCL IND 25
 06 /
 07 RCL 21
 08 -
 09 STO 06
 10 RCL 07
 11 7ISZ
 12 RCL IND 25
 13 STO 07
 14 /
 15 *
 16 STO 05
 17 ASIN
 18 CHS
 19 RCL 06
 20 ASIN
 21 +
 22 RCL 21
 23 ASIN
 24 +
 25 SIN
 26 RCL 21
 27 X<>Y
 28 STO 21
 29 ASIN
 30 COS
 31 RCL 05
 32 ASIN
 33 COS
 34 +
 35 RCL 20
 36 *
 37 X<>Y
 38 ASIN
 39 COS
 40 RCL 06
 41 ASIN
 42 COS
 43 +
 44 /
 45 STO 05
 46 RCL 21
 47 /
 48 STO 03
 49 RCL 05
 50 RCL 21
 51 7ISZ
 52 RCL IND 25
 53 *
 54 -
 55 STO 20
 56 XEQ 00
 57 X=0?
 58 GTO 02
 59 GTO 03
 60 LBL 02
 61 FS? 01
 62 GTO 19
 63 RCL 22
 64 RCL 03
 65 STOP
 66 X<>Y
 67 RCL 21
 68 *
 69 RCL 05
 70 X<>Y
 71 -
 72 RCL 21
 73 ASIN
 74 COS
 75 /
 76 STO 04
 77 STOP
 78 LBL 03
 79 19
 80 RCL 25
 81 7ISZ
 82 X#Y?
 83 GTO 10
 84 FS? 01
 85 GTO 04
 86 XEQ 06
 87 GTO 10
 88 LBL 06
 89 19
 90 STO 25
 91 STOP
 92 8
 93 STO 25
 94 RTN
 95 LBL 04
 96 4
 97 ST- 00
 98 8
 99 STO 25
100 RCL 01
101 STO 07
102 GTO 14
103 LBL 12
104 LBL C
105 SF 01
106 RCL 00
107 STO 02
108 RCL 07
109 STO 01
110 GTO 10
111 LBL 00
112 RCL 00
113 PSE
114 1
115 ST+ 00
116 RCL IND 25
117 RTN
118 LBL 14
119 LBL E
120 RCL 23
121 RCL IND 25
122 /
123 7ISZ
124 RCL IND 25
125 RCL 07
126 -
127 *
128 RCL IND 25
129 /
130 RCL 07
131 RCL 24
132 *
133 RCL IND 25
134 STO 07
135 /
136 +
137 STO 24
138 7ISZ
139 RCL IND 25
140 *
141 RCL 23
142 X<>Y
143 -
144 STO 23
145 RCL 24
146 /
147 STO 02
148 XEQ 00
149 X=0?
150 GTO 01
151 GTO 05
152 LBL 01
153 FS? 01
154 GTO 17
155 RCL 22
156 RCL 02
157 STOP
158 X<>Y
159 RCL 24
160 *
161 RCL 23
162 X<>Y
163 -
164 STO 04
165 STOP
166 LBL 17
167 LBL c
168 CF 01
169 RCL 03
170 RCL 02
171 -
172 STO 05
173 STOP
174 RCL 24
175 RCL 21
176 /
177 RCL 02
178 RCL 22
179 -
180 *
181 RCL 03
182 RCL 22
183 -
184 /
185 1
186 -
187 STO 06
188 STOP
189 LBL 05
190 19
191 RCL 25
192 7ISZ
193 X#Y?
194 GTO 14
195 FS? 01
196 GTO 15
197 XEQ 06
198 GTO 14
199 LBL 19
200 LBL e
201 RCL 01
202 STO 07
203 RCL 02
204 STO 00
205 8
206 STO 25
207 GTO 14
208 LBL 15
209 LBL a
210 XEQ 06
211 RCL 00
212 STO 02
213 RCL 07
214 STO 01
215 GTO 10
216 LBL 11
217 LBL B
218 STO 25
219 RCL IND 25
220 1/X
221 RCL 01
222 +
223 1/X
224 STO IND 25
225 PSE
226 RCL 25
227 3
228 +
229 STOP
230 END

Go back to the HP-41 software library
Go back to the general software library
Go back to the main exhibit hall