The Museum of HP Calculators


Hyperbolic Triangles for the HP-41

This program is Copyright © 2005 by Jean-Marc Baillard and is used here by permission.

This program is supplied without representation or warranty of any kind. Jean-Marc Baillard 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.

Overview

-This program finds the sides and the angles of a hyperbolic triangle.
-It works in all angular modes but angles must be entered as decimals.
-It conforms to the standard triangle notation ( 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 Listing
 

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.
 
 

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