Hyperbolic Triangles for the HP-41
Overview
-These 2 program find the sides and the angles of a hyperbolic triangle.
-They work in all angular modes but angles must be entered as decimals.
-The standard triangle notation is employed ( A opposite a ... etc
... )
Formulae:
sinh a / sin
A = sinh b / sin B = sinh c / sin C
cosh a = cosh
b cosh c - sinh b sinh c cos A
cos A
= -cos B cos C + sin B sin C cosh a
c = arctanh ( cos A tanh b ) + arctanh ( cos B
tanh a )
A
*
* * b
c *
*
we must have A + B + C < 180°
*
*
B *
* * * *
* * C
a
Program Listing1 ( without M-Code routines )
Data Registers: When the program stops:
R01 = a R04 =
A
( R00 , R07 , R08: temp )
R02 = b R05 =
B
R03 = c R06 =
C
Flags: /
Subroutines: /
01 LBL "HABC"
02 GTO IND T 03 LBL 00 04 STO 04 05 RDN 06 STO 05 07 X<>Y 08 STO 06 09 R^ 10 XEQ 09 11 STO 01 12 LBL 06 13 RCL 04 14 RCL 06 15 RCL 05 16 XEQ 09 17 STO 02 18 RCL 04 19 RCL 05 20 RCL 06 21 XEQ 09 22 STO 03 23 RCL 02 24 RCL 01 25 RTN 26 LBL 01 27 STO 01 28 RDN 29 STO 05 30 X<>Y 31 STO 06 32 1 33 P-R 34 X<> Z 35 LASTX 36 P-R 37 ST* T 38 RDN 39 * 40 RCL 01 41 E^X 42 ENTER^ |
43 1/X
44 + 45 * 46 2 47 / 48 X<>Y 49 - 50 ACOS 51 STO 04 52 XEQ 06 53 CLX 54 RCL 04 55 RTN 56 LBL 02 57 STO 01 58 X<>Y 59 STO 02 60 X<> Z 61 STO 06 62 XEQ 12 63 RCL 00 64 COS 65 * 66 - 67 4 68 / 69 XEQ 10 70 STO 03 71 XEQ 07 72 RCL 03 73 RCL 05 74 RCL 04 75 RTN 76 LBL 03 77 STO 01 78 X<>Y 79 STO 02 80 X<> Z 81 STO 03 82 XEQ 11 83 STO 06 84 LBL 07 |
85 RCL 01
86 RCL 03 87 RCL 02 88 XEQ 11 89 STO 05 90 RCL 02 91 RCL 03 92 RCL 01 93 XEQ 11 94 STO 04 95 RCL 06 96 RCL 05 97 RCL 04 98 RTN 99 LBL 04 100 XEQ 14 101 STO 04 102 SIN 103 ST+ X 104 / 105 ENTER^ 106 X^2 107 1 108 + 109 SQRT 110 + 111 LN 112 STO 02 113 XEQ 13 114 RCL 02 115 RTN 116 LBL 05 117 XEQ 14 118 STO 02 119 E^X 120 ENTER^ 121 1/X 122 - 123 / 124 ASIN 125 LBL 08 126 STO 04 |
127 XEQ 13
128 RCL 04 129 RTN 130 RCL 04 131 COS 132 CHS 133 ACOS 134 GTO 08 135 LBL 09 136 STO 00 137 SIGN 138 P-R 139 X<> Z 140 LASTX 141 P-R 142 ST* T 143 RDN 144 * 145 X<>Y 146 RCL 00 147 COS 148 + 149 X<>Y 150 / 151 LBL 10 152 ENTER^ 153 X^2 154 1 155 - 156 SQRT 157 + 158 LN 159 RTN 160 LBL 11 161 XEQ 12 162 X<>Y 163 RCL 00 164 E^X 165 ENTER^ 166 1/X 167 + 168 ST+ X |
169 -
170 X<>Y 171 / 172 ACOS 173 RTN 174 LBL 12 175 STO 00 176 RDN 177 E^X 178 STO 07 179 ENTER^ 180 1/X 181 ST- 07 182 + 183 X<>Y 184 E^X 185 STO 08 186 ENTER^ 187 1/X 188 ST- 08 189 + 190 * 191 RCL 07 192 RCL 08 193 * 194 RTN 195 LBL 13 196 RCL 02 197 ST+ X 198 E^X-1 199 RCL X 200 2 201 + 202 / 203 RCL 04 204 COS 205 * 206 ENTER^ 207 ST+ Y 208 CHS 209 1 210 + |
211 /
212 LN1+X 213 RCL 01 214 ST+ X 215 E^X-1 216 RCL X 217 2 218 + 219 / 220 RCL 05 221 COS 222 * 223 ENTER^ 224 ST+ Y 225 CHS 226 1 227 + 228 / 229 LN1+X 230 + 231 2 232 / 233 STO 03 234 RCL 01 235 RCL 02 236 RCL 03 237 XEQ 11 238 STO 06 239 RCL 03 240 RTN 241 LBL 14 242 STO 01 243 E^X 244 ENTER^ 245 1/X 246 - 247 R^ 248 STO 05 249 SIN 250 * 251 X<>Y 252 END |
( 311 bytes / SIZE 009 )
-Execution time ~ 8 seconds
1°) First case: the 3 angles are known
STACK | INPUTS | OUTPUTS |
T | 0 | / |
Z | C | c |
Y | B | b |
X | A | a |
Example: A = 30° , B = 40°
, C = 50°
0 ENTER^
50 ENTER^
40 ENTER^
30 XEQ "HABC" >>>> a = 1.6733
RDN b = 1.9108 RDN c = 2.0799
2°) Second case: 1 side and the 2 adjacent angles
are known
STACK | INPUTS | OUTPUTS |
T | 1 | / |
Z | C | c |
Y | B | b |
X | a | A |
Example: a = 2 , B = 30° , C =
40°
1 ENTER^
40 ENTER^
30 ENTER^
2 XEQ "HABC" >>>> A = 56.9253°
RDN b = 1.5147 RDN c = 1.7472
3°) Third case: 2 sides and the included angle
are known
STACK | INPUTS | OUTPUTS |
T | 2 | / |
Z | C | c |
Y | b | B |
X | a | A |
Example: a = 1 b
= 1.5 C = 20°
2 ENTER^
20 ENTER^
1.5 ENTER^
1 XEQ "HABC" >>>> A = 30.3009°
RDN B = 113.9150° RDN c
= 0.7301
4°) Fourth case: 3 known sides
STACK | INPUTS | OUTPUTS |
T | 3 | / |
Z | c | C |
Y | b | B |
X | a | A |
Example: a
= 1.2 b = 1.4 c = 2
3 ENTER^
2 ENTER^
1.4 ENTER^
1.2 XEQ "HABC" >>>>
A = 24.5664° RDN B = 31.6345°
RDN C = 87.3612°
5°) Fifth case: 1 side , the opposite angle
and another angle are known
STACK | INPUTS | OUTPUTS |
T | 4 | / |
Z | B | C |
Y | A | c |
X | a | b |
Example: a = 1.4
A = 20° B = 30°
4 ENTER^
30 ENTER^
20 ENTER^
1.4 XEQ "HABC" >>>> b =
1.7478 RDN c = 2.4078
RDN C = 81.7297°
6°) Sixth case: 2 sides and one adjacent angle
known
STACK | INPUTS | OUTPUTS1 | OUTPUTS2 |
T | 5 | / | / |
Z | B | C | C' |
Y | b | c | c' |
X | a | A | A' |
Example: a = 2 b = 1.4
B = 30°
5 ENTER^
30 ENTER^
1.4 ENTER^
2 XEQ "HABC"
>>>> A = 72.2284° RDN
c = 1.4811 RDN C = 33.1961°
R/S
>>>> A' = 107.7716° RDN c' = 0.9269
RDN C' = 16.2449°
-In this case, there are 2 solutions.
-If the results contain non-positive numbers, the 2nd solution must
be rejected
-Anyway, check that A + B + C < 180°
-In cases 1-2-3-4 , T-register input = the number of known sides.
Program Listing2 ( with M-Code routines )
-The program may of course be simplified if we use the hyperbolic functions
SINH COSH TANH ASINH ACOSH ATANH
-See for example "A few M-Code Routines for the HP-41"
Data Registers: When the program stops:
R01 = a R04 =
A
( R00: temp )
R02 = b R05 =
B
R03 = c R06 =
C
Flags: /
Subroutines: /
01 LBL "HABC"
02 GTO IND T 03 LBL 00 04 STO 04 05 RDN 06 STO 05 07 X<>Y 08 STO 06 09 R^ 10 XEQ 09 11 STO 01 12 LBL 06 13 RCL 04 14 RCL 06 15 RCL 05 16 XEQ 09 17 STO 02 18 RCL 04 19 RCL 05 20 RCL 06 21 XEQ 09 22 STO 03 23 RCL 02 24 RCL 01 25 RTN 26 LBL 01 27 STO 01 28 RDN 29 STO 05 30 X<>Y 31 STO 06 32 1 |
33 P-R
34 X<> Z 35 LASTX 36 P-R 37 ST* T 38 RDN 39 * 40 RCL 01 41 COSH 42 * 43 X<>Y 44 - 45 ACOS 46 STO 04 47 XEQ 06 48 CLX 49 RCL 04 50 RTN 51 LBL 02 52 STO 01 53 X<>Y 54 STO 02 55 X<> Z 56 STO 06 57 XEQ 12 58 RCL 00 59 COS 60 * 61 - 62 ACOSH 63 STO 03 64 XEQ 07 |
65 RCL 03
66 RCL 05 67 RCL 04 68 RTN 69 LBL 03 70 STO 01 71 X<>Y 72 STO 02 73 X<> Z 74 STO 03 75 XEQ 11 76 STO 06 77 LBL 07 78 RCL 01 79 RCL 03 80 RCL 02 81 XEQ 11 82 STO 05 83 RCL 02 84 RCL 03 85 RCL 01 86 XEQ 11 87 STO 04 88 RCL 06 89 RCL 05 90 RCL 04 91 RTN 92 LBL 04 93 XEQ 14 94 STO 04 95 SIN 96 / |
97 ASINH
98 STO 02 99 XEQ 13 100 RCL 02 101 RTN 102 LBL 05 103 XEQ 14 104 STO 02 105 SINH 106 / 107 ASIN 108 LBL 08 109 STO 04 110 XEQ 13 111 RCL 04 112 RTN 113 RCL 04 114 COS 115 CHS 116 ACOS 117 GTO 08 118 LBL 09 119 STO 00 120 SIGN 121 P-R 122 X<> Z 123 LASTX 124 P-R 125 ST* T 126 RDN 127 * 128 X<>Y |
129 RCL 00
130 COS 131 + 132 X<>Y 133 / 134 ACOSH 135 RTN 136 LBL 11 137 XEQ 12 138 X<>Y 139 RCL 00 140 COSH 141 - 142 X<>Y 143 / 144 ACOS 145 RTN 146 LBL 12 147 STO 00 148 RDN 149 COSH 150 LASTX 151 SINH 152 RCL Z 153 COSH 154 ST* Z 155 X<> L 156 SINH 157 * 158 RTN 159 LBL 13 160 RCL 02 |
161 TANH
162 RCL 04 163 COS 164 * 165 ATANH 166 RCL 01 167 TANH 168 RCL 05 169 COS 170 * 171 ATANH 172 + 173 STO 03 174 RCL 01 175 RCL 02 176 RCL 03 177 XEQ 11 178 STO 06 179 RCL 03 180 RTN 181 LBL 14 182 STO 01 183 SINH 184 RCL Z 185 STO 05 186 SIN 187 * 188 X<>Y 189 END |
( 255 bytes / SIZE 007 )
-The instructions are identical.
-We get the same results with the same examples...