Wednesday, September 21, 2016

TI-84 Plus CE and HP Prime: Pitch versus Angle

TI-84 Plus CE and HP Prime:  Pitch versus Angle

The program PITCH calculates the pitch and angle of various roof heights.  The pitch of a roof is the number of inches of vertical rise per 12 inches.  For example: a roof of 3/12 is pitch is a roof that rises 3 inches for every 12 horizontal inches. 

This program demonstrates the angle computer given different roof pitches.  You control the rise, anywhere for 0.5 ft to 12 ft.   Use the up and down arrow keys to control the rise. 

To exit the program:

TI-84 Plus CE:  Press [CLEAR]. 
HP Prime:  Press [Esc].

TI-84 Plus CE: PITCH



"9/8/2016 EWS"
FnOff
ZoomSto
ZStandard

AxesOff
6→H:0→K
Degree
ClrDraw
Repeat K=45
getKey→K

TextColor(BLUE)
Text(­1,0,10,"PITCH = ")
Text(­1,0,110,H)
Text(­1,0,160,"/12")

Line(­4,­4,4,­4,GREEN)
Line(4,­4,4,­4+H,ORANGE)
Line(­4,­4,4,­4+H,GREEN)

TextColor(BLACK)
Text(­1,130,10,"ANGLE = ")
Text(­1,130,115,tan(H/12)

If K=25 and H≠12
Then
ClrDraw
H+.5→H
End
If K=34 and H≠0.5
Then
H-.5→H
ClrDraw
End

End

AxesOn
ZoomRcl
Disp "DONE."


HP Prime:  PITCH



EXPORT PITCH()
BEGIN
// HP Prime, EWS 2061-09-21

Xmin:=−10;Xmax:=10;
Ymin:=−10;Ymax:=10;

LOCAL h,k,a,t,s1,s2;
k:=0; h:=6; a:=HAngle;
HAngle:=1;
RECT(0);
REPEAT

k:=GETKEY;

s1:="Pitch = "+h+"/12";
TEXTOUT(s1,−5,8,4,#7DF9FFh);

LINE(−4,−4,4,−4,#FF00h);
LINE(4,−4,4,−4+h,#EDC9AFh);
LINE(−4,−4,4,−4+h,#FF00h);

t:=ATAN(h/12);
s2:="Angle = "+t+"°";
TEXTOUT(s2,−5,−8,4,#7DF9FFh);

// UP
IF k==2 AND h≠12 THEN
RECT(0); h:=h+.5;
END;

// DOWN
IF k==12 AND h≠.5 THEN
RECT(0); h:=h-.5;
END

UNTIL k==4; // Esc

RETURN "Done.";

END;


Update & HHC 2016 Highlights to come!

I have returned from Colorado attending the HHC 2016 conferences.  The weekend went by way too fast!  Highlights are going to come later this week.


Eddie

This blog is property of Edward Shore, 2016.

Spotlight: Akron Brass FireCalc Pocket Computer

Spotlight: Akron Brass FireCalc Pocket Computer Welcome to a special Monday Edition of Eddie’s Math and Calculator blog. Thi...