Files in directory jrpn-15c/hypotenuse in any check-in
- hypotenuse.15c
- README.md
Description
Calculate either the length of a right triangle’s hypotenuse given the lengths of the legs, or one leg given the other and the hypotenuse.
Usage
Hypotenuse: leg
ENTER
leg
XEQ
A
Other Leg: hyp
ENTER
leg
XEQ
B
Resources
X and Y are consumed, with the answer in X.
- X: leg length on input, answer on output
- Y: hypotenuse (program A) or other leg (program B) on input
- variables: none
- flags: none
Compatibility
Written using the JRPN 15c simulator, and directly importable as such.
The code can be entered as-is into a hardware HP-11C, 15C, 32S, 32SII, 33s, or 35s. For an improved version taking better advantage of the 30-series machines, see this.
The HP-16C lacks the x² function, but that is easily emulated with ENTER
×
.
The HP-12C has the same lack, and you can use the same workaround, but there are better alternatives.
See Also
Motivation here, plus other variants, including a version of the “leg” program with the HP-12C modification suggested above, plus adaptation to its weaker calling syntax.