Post Reply 
(11C) Tree Heights
11-02-2018, 06:15 PM (This post was last modified: 11-02-2018 09:48 PM by Dieter.)
Post: #3
RE: (11C) Tree Heights
(11-02-2018 01:24 PM)Gamo Wrote:  This program was adapted from the Hand-Held-Calculator Programs
for the Field Forester.

More detail information attached here.

Thank you very much. The attached program description seems to refer to a TI program: enter three values with four (!) label keys, finally press another key for the result. But this is HP, the 11C uses RPN, here all this can be done much shorter and more straightforward, even without using a single data register. A direct translationm on the other hand, duplicates the clumsy original procedure:

(11-02-2018 01:24 PM)Gamo Wrote:  1. Enter slope distance to base of tree [A] -->Display known distance

2. Enter Slope percent to tip, [R/S] --> Display 0 (Slope to tip Stored)

3. Enter Slope percent to Base.

I. If Positive [B] --> display 0 // slope base entered
II. If Negative [C] --> display 0 // slope base entered

4. [D] ---> Tree Heights

We can do better. ;-)

First of all, mathematically there is no need to distinguish positive or negative base angles and handle them separately. The same formula will work for both cases, as tan(–x) = –tan(x). Also there is no need to calculate sin(90°–B1) as this is equivalent to cos(B1).

Converting the slope values to angles is done in a subroutine. But on the 11C this is merely four steps,*) so two calls require (2x GSB, LBL, 4 steps, RTN) eight lines altogether. This does not save any program steps, compared to having the same four steps twice in the program. So a subroutine has no advantage, and without it the program would even run slightly faster. I left it in there anyway so that the user may do the slope-to-angle conversion with f[E], independently from the rest of the program.

Here is my attempt at realizing all this in a compact 10/11/15C program, but it should run just as well on many other HPs. If your calculator does not feature LBL A or LBL E simply replaced them with numeric ones.

Code:
01 LBL A
02 GSB E
03 X<>Y
04 GSB E
05 COS
06 X<>Y
07 LstX
08 X<>Y
09 -
10 SIN
11 X<>Y
12 ÷
13 x
14 RTN
15 LBL E
16 EEX
17 2
18 ÷
19 TANˉ¹
20 RTN

Enter base distance [ENTER] tip slope percent [ENTER] base slope percent.
Press f[A] to get the tree height.

Additional feature:
Enter slope percent, press f[E] and get the equivalent angle.

Examples, using your above data:

56  [ENTER]  40  [ENTER] –20 f[A] => 32,95
56  [ENTER]  40  [ENTER]  20  f[A] => 10,98

What is the equivalent angle for a slope of 30% ?
30 f[E] => 16,70°

Edit: here is a version for the HP25(C) which may also run on other calculators without labels and subroutines:

Code:
01 ENTER
02 EEX
03 2
04 ÷
05 TANˉ¹
06 X<>Y
07 EEX
08 2
09 ÷
10 TANˉ¹
11 COS
12 X<>Y
13 LastX
14 X<>Y
15 -
16 SIN
17 X<>Y
18 ÷
19 x
20 GTO 00

Dieter
__________
*) In your original program you could even do it with 3 steps: 1 % TANˉ¹
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
(11C) Tree Heights - Gamo - 11-02-2018, 01:24 PM
RE: (11C) Tree Heights - SlideRule - 11-02-2018, 02:43 PM
RE: (11C) Tree Heights - Dieter - 11-02-2018 06:15 PM
RE: (11C) Tree Heights - SlideRule - 11-02-2018, 07:03 PM
RE: (11C) Tree Heights - Dieter - 11-02-2018, 07:41 PM
RE: (11C) Tree Heights - Gamo - 11-03-2018, 01:35 AM
RE: (11C) Tree Heights - Dieter - 11-03-2018, 12:47 PM
RE: (11C) Tree Heights - Thomas Klemm - 11-04-2018, 03:32 PM
RE: (11C) Tree Heights - Dieter - 11-04-2018, 04:57 PM
RE: (11C) Tree Heights - ijabbott - 11-22-2018, 05:27 PM
RE: (11C) Tree Heights - Gamo - 11-05-2018, 12:52 AM



User(s) browsing this thread: 1 Guest(s)