(20S and 21S) Triangle Program - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Software Libraries (/forum-10.html) +--- Forum: General Software Library (/forum-13.html) +--- Thread: (20S and 21S) Triangle Program (/thread-8452.html) |
(20S and 21S) Triangle Program - Eddie W. Shore - 06-03-2017 06:29 PM Given three Cartesian coordinates, through points (R1, R4), (R2, R5), and (R3, R6), this program calculates: 1. The lengths of each side, represented by R7, R8, and R9. 2. The angle between lines connected by (R1, R4)-(R2, R5) and (R2, R5)-(R3, R6). The angle is stored in R0. 3. The area of the triangle. This is the final results shown. [see diagram below] The keystrokes for the HP 20S and HP 21S in this program are the same. Store the coordinates in variables R1 through R6, then press XEQ A. HP 20S and HP 21S Program: Triangle Program Code:
Example: Inputs: (R1, R4) = (4, 8) (R2, R5) = (2, 3) (R3, R6) = (3, 10) Outputs: R7 = 5.3852 R8 = 7.0711 R9 = 2.2361 R0 = 34.6952° Area = 10.8374 |