Showing posts with label HP 75C. Show all posts
Showing posts with label HP 75C. Show all posts

Sunday, December 10, 2023

HP 71B and HP 75C: Degrees and DMS Conversions

HP 71B and HP 75C:  Degrees and DMS Conversions



At default, the HP 71B and HP 75C do not have conversions between degrees and degrees-minutes-seconds.   Here are two short programs to remedy this and can be used as subroutines.  The language used is BASIC.



HP 71B and HP 75C Code:  DMS to Degrees.  File Name: DMS2D


10 INPUT "d, m, s? ": H, M, S

20 D=SGN(H)*(ABS(H)+M/60+S/3600)

30 PRINT D; "°"




HP 71B and HP 75C Code:   Degrees to DMS.   File Name:  D2DMS


10  INPUT "DEC DEG? "; D

20 G=SGN(D) @ D=ABS(D) @ H=IP(D)

30 M=IP(FP(D)*60)

40 S=FP(FP(D)*60)*60

50 PRINT G*H; "°"; M; "m"; S; "s"



Notes:  


1.  The degree character, °, can be typed by the following combinations:

HP 71B:  g, CTRL, A

HP 75C:  CTL + A


2.  When entering DMS, separate degrees, minutes, and seconds by commas.  For negative degrees in DMS format, enter the negative sign in front of degrees.  


3.  Repeating decimals (like 42.606666666...) may produce approximate conversions.  



Examples to Try


43.25° ←→ 43° 15m 0s 


-63.27°  ←→ -63° 16m 12s


42.60166667° ←→ 42° 36m 6s  (about)




Eddie


All original content copyright, © 2011-2023.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author. 


Sunday, December 25, 2022

HP 75C Program Collection

HP 75C Program Collection


Merry Christmas everyone!   I hope everyone is safe, happy, and blessed.



LAWCOS:  Law of Cosines

335 bytes


100 DISP "Law of Cosines" @ WAIT .25

105 OPTION ANGLE DEGREES

180 DISP "Θ is opp. side a" @ WAIT .25

110 INPUT "1) Side, 2) Angle? "; H

115 ON H GOTO 1000, 2000


1000 INPUT "b?, c?, Θ? "; B,C,T

1010 A=SQR(B^2+C^2-2*B*C*COS(T))

1020 DISP "a: "; STR$(A) @ END


2000 INPUT "a?, b?, c? "; A,B,C

2010 T=ACOS((B^2+C^2-A^2)/(2*B*C))

2020 DISP "Θ:"; STR$(T); "°" @ END


Example:

1) Side:  1

B = 11.78, C = 32.12, T = 60

Result:  a = 28.1440793063


2)  Angle: 2

A = 14.55, B = 12.65, C = 17.00

Result:  Θ = 56.5108780171°



SPECPOLY:  Special Polynomials

526 bytes  (10/27/2022)


1.Cheb:  Chebyshev Polynomial of the 1st order

2.Herm:  Hermite Polynomial 

3.Lagur:  Laguerre Polynomial (with α=0)

4.Legen:  Legendre Polynomial of the 1st Order


100 DISP "Polynomials:  Type?" @ WAIT .5

105 INPUT "1.Cheb 2.Herm 3.Lagur 4.Legen:"; H

110 INPUT "x? "; X

115 INPUT "order? ";N

120 A=1 @ B=X*(H=1 OR H=4)+2*X*(H=2)+(1-X)*(H=3)


300 IF N=0 THEN DISP A @ END

302 IF N=1 THEN DISP B @ END

305 FOR I=2 TO N

310 ON H GOSUB 500,505,510,515

315 A=B

320 B=C

325 NEXT I

330 DISP C

335 END


500 C=2*X*B-A @ RETURN

505 C=2*X*B-2*(I-1)*A @ RETURN

510 C=((2*(I-1)+1-X)*B-(I-1)*A)/I @ RETURN

515 C=((2*I-1)*X*B-(I-1)*A)/I @ RETURN


Source:


Davidson, James J.  "Chebyshev Polynomials, First & Second Kind, Tn(x) & Un(x)", "Hermite Polynomials, H(n); n≥n", "Laguerre Polynomials, Generalized, Ln^(α)(x)", "Legendre Functions, First & Second Kinds, Pn(x) & Qn(x)"  ENTER 65 NOTES  Vol. 3 No. 8 September 1976  pp. 11-12



Examples:

x = 11, order = 6

1.  Cheb:  55989361

2.  Herm: 106439224

3.  Lagur: -35.5902777778

4.  Legen: 25289461


ENGINE:  Automotive Engine Mathematics

630 bytes (10/27/2022)


100 DISP "Engine Math" @ WAIT .5

110 INPUT "# cylinders? "; N

120 DISP "Solve for?" @ WAIT .25

125 INPUT "1)DSP, 2)STROKE, 3)BORE "; H

130 IF H#1 THEN INPUT "DSP? "; D

135 IF H#2 THEN INPUT "STROKE? "; S

140 IF H#3 THEN INPUT "BORE? "; B

145 IF H=1 THEN LET D=PI/4*B^2*S*N

150 IF H=2 THEN LET S=D/(PI/4*B^2*N)

155 IF H=3 THEN LET B=SQR(D/(PI/4*S*N))

160 DISP "DPS= "; D @ STOP

165 DISP "STORKE= "; S @ STOP

170 DISP "BORE= "; B @ STOP


205 INPUT "RPM? (y/n) "; I$

210 IF UPRC(I$)="N" THEN 400


300 INPUT "RPM? "; R

310 P=S*R/6

320 E=R*D*.85/3456

350 DISP "Piston Speed="; P @ STOP

360 DISP "St. Carb CFM= "; E @ STOP

370 INPUT "Again? (y/n) "; I$ 

375 IF UPRC(I$)="Y" THEN 300


400 DISP "Done."


Source:


Lawlor, John.  Auto Math Handbook.  Calculations, Formulas, Equations, and Theory for Automotive Enthusiasts.  HP Books:  Berkeley Publishing Group:  New York, NY.  1991.  ISBN 1-55788-020-4


LINREG:  Linear Regression

568 bytes (10/31/2022)


100 DISP "y=mx+b" @ WAIT .5

110 S0=0 @ S1=0 @ S2=0 @ S3=0 @ S4=0 @ S5=0

120 DISP 'Σ+ Σ- Calc'

130 K$=KEY$ @ IF K$='' THEN 130

140 IF K$="+" THEN H=1 @ GOTO 200

150 IF K$="-" THEN H=-1 @ GOTO 200

160 IF UPRC$(K$)='C' THEN 400

170 GOTO 130


200 INPUT 'x,y? '; X,Y

210 S0=S0+H @ S1=S1+H*X @ S2=S2+H*Y

220 S3=S3+H*X^2 @ S4=S4+H*Y^2 @ S5=S5+H*X*Y

230 DISP S0 @ WAIT .5 @ GOTO 120


400 B=(S5-S1*S2/S0)/(S3-S1^2/S0)

440 A=(S2-B*S1)/S0

450 R=B*SQR((S0*S3-S1^2)/(S0*S4-S2^2))

470 DISP 'type cont...' @ WAIT .5


500 DISP 'SLP=';B @ STOP

510 DISP 'ITC=';A @ STOP

520 DISP 'CORR=';R


Instructions:

Press + to add data.  Separate  x and y with a comma.

Press - to delete data.  Separate x and y with a comma.

Press C to determine the slope, intercept, and correlation.


Example:

Data:

5, 4.066

8, 4.125

11, 4.202

18, 4.293

21, 4.349


ITC ≈ 3.99046

SLP ≈ 0.01719

CORR ≈ 0.99376


Source:


Hewlett Packard.  HP 12C User Guide  Edition 4.  San Diego, CA  2004.


SIMPSON:  Integral Using Simpson’s Rule Approximation

size varies - around 300 bytes


∫ FNF(X) dX from X = a to X = b


Line 100 is where you have to define your function (of X). 


100 DEF FNF(X) = [define f(x) here]


115 OPTION ANGLE RADIANS

120 INPUT "a? ";A

125 INPUT "b? ";B

130 INPUT "# parts (even)? ";N

135 T=FNF(A)+FNF(B)

140 H=(B-A)/N

145 FOR I TO N-1

150 IF FP(I/2)=0 THEN 155 ELSE 160

155 T=T+2*FNF(A+I*H) @ GOTO 165

160 T=T+4*FNF(A+I*H)

165 NEXT I

170 T=T*H/3

175 DISP "Integral = ";T


Examples:

For both examples, n = 24


FNF(X)= 2*X^2+3,  a = 1, b = 6, result:  158.333333333


FNF(X)=2*COS(X), a = 0, b = .785398163398, result:  1.41421357139  (exact √2)




Happy Holidays everyone!


Next post will be on New Years' Eve:  December 31, 2022.


Eddie 


All original content copyright, © 2011-2022.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author. 


Saturday, December 24, 2022

Retro Review: HP 75C

Retro Review:  HP 75C



It's Christmas Eve!





Quick Facts


Model:  HP 75C 

Company:  Hewlett Packard

Years:  1982-1984

Type:  Scientific, BASIC Programmable

Batteries: Rechargeable Ni-CAD, with AC-Adapter**

Display:  1 line, 32 characters

Original Price:  $995

Memory:  16,000 bytes RAM with a slot for an 8K RAM Card

Other Ports:  3 ROM slots for applications 

Hard Case which stores the HP 75 and the cards, but not the AC adapter


The HP 75C (and later HP 75D) has an 8-bit CPU microprocessor named the Capricorn.   The Capricorn microprocessors where featured in the HP 85 computer.


For fans of tropical astrology, this article is posted on December 24, under the sign of Capricorn.   ♑  The Capricorn processor was designed by a Steve Wozniak, a Leo.  But I digress.



Introduction


The HP 75C computer is a portable computer with an almost full sized QWERTY keyboard.  The 75C is a scrolling one-line display that can have up to 32 characters.  The keyboard works like a computer keyboard: the [SHIFT] key must be pressed and held to type capital letters.


The keyboard is nice to type and with the correct size of hands, touch typing can be accomplished.  It also has a numeric keypad that can be activated by holding down [CTL] while pressing [LOCK].   Pressing [LOCK] ends the numeric keypad mode.


[ 7 ]  returns 7

[ 8 ]  returns 8

[ 9 ]  returns 9

[ U ] returns 4

[ I ] returns 5

[ O ] returns 6

[ J ] returns 1

[ K ] returns 2

[ L ] returns 3

[ M ] returns 0


Other characters can be accessed by holding down the [CTL] key and pressing another key.   Example characters that can be typed this way are:


CTL + Space:  Δ

CTL + A:  °

CTL + D:  α

CTL + I:  σ

CTL + P:  θ

CTL + T:  π

CTL + plus key:  Σ


The keyboard also has an HP-IL port and a card reader.  The card reader is manual, requiring the user to pull the card at just the right speed to record programs.  Transferring programs to cards, which are long and skinny, takes a lot of patience.  Each card be pulled in two ways and each way can store a program up to only 650 bytes.   Every time a new program is stored in a track, that new program replaces the previous contents.     


The battery is a rechargeable Ni-CAD battery.  If you purchase a HP 75C, I advise you to get one with a working AC plug.  According to the HP 75 Owner's Manual, it takes about 8 hours for the batteries to fully recharge.  


See the Sources section for a download link to the Owner's Manual.  


How to turn the HP 75C on?   There is no ON key.   The [ATTN] (attention) key takes care of this.  To turn the 75C off, hold [SHIFT] and press [ATTN] or type bye then [RTN]. 



Modes


The HP 75C has three operating modes:


TIME: setting the computer's clock and time.  Thankfully the HP 75C is Y2K friendly and allows dates after 2000.


APPT:  set and check personal appointments.


EDIT:  the main mode of the HP 75C computer.  This is where all the basic programs are edited, stored, and ran.   The Edit mode can handle one line algebraic calculations, with the order of operations followed.  



Programming


The HP 75C has BASIC programming language, although not as extensive as the HP 71B.  It's probably the one slight problem I have with the 75C, but missing functions can be programmed.   In tomorrow's post, I have a simple linear regression which the 75C's list of commands lack commands for.


What is included?  A short list includes:


*  square roots, modulus, sign, maximum, minimum, random numbers, remainder, integer part, fractional part 

*  the constants PI, INF (9.99999999999E499), EPS (1E-499)

*  degree/radian angle conversions, trigonometric functions, angle (atan2), sec, sec, cot, logarithms (log10 and log (for ln, this is a computer language))

*  relational tests (evaluated to 0 for false or 1 for true), logic (and, or, exor (either or but not both), not)

*  strings, alarm settings, beep, read and data, goto and label, for-to-step structure, if-then-else structure, character, date and time strings, arrays

*  printing and user function commands


Remember, in programming the 75C, line numbers are required.   


Like the HP 71B, I find it a joy to program the 75C.  



The Updated HP 75D


The HP 75D was an updated HP 75C computer and produced in rare supply from 1984 to 1986.  The retail price of an HP 75D was $1,095 and included a port for a  bar code wand. Yes, the same type of bar codes that you see on grocery products and you scan at the self checkout lines.   



Final Thoughts 


The HP 75C is not an inexpensive purchase.  If you buy one, please be sure you see pictures from the seller with the unit turned on.  In addition, at the very least, make sure it has working batteries and the AC adapter.   The going price for the HP 75C these days from at least $250 US.   


It is a worthwhile machine especially for fans of BASIC and a good companion to the HP 71B.   I am happy to have the 75C in my collection, which is years I missed out on winning one as a door prize.  



Sources


"HP-75"  Wikipedia.  September 7, 2021.   Retrieved December 4, 2022.  https://en.wikipedia.org/wiki/HP-75


"HP-75C/D"  Museum of HP Calculators.   Retrieved December 4, 2022.

https://www.hpmuseum.org/hp75.htm


Hewlett Packard.  HP-75 Owner's Manual.  Rev. B   November 1982.  

Download from the hpcalc.org's literature page here:  https://literature.hpcalc.org/items/1072



Until next time, keep happy and sane,


Eddie 



All original content copyright, © 2011-2022.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author. 


HP 71B Basic and Casio fx-CG 100: Weighted Random Sample

HP 71B Basic and Casio fx-CG 100: Weighted Random Sample Introduction In calculators, it is fairly easy to generate a rand...