Showing posts with label triangles. Show all posts
Showing posts with label triangles. Show all posts

Saturday, June 8, 2024

Casio fx-4000P - The Programs I took on Vacation

 Casio fx-4000P - The Programs I took on Vacation


I was on vacation in Atascadero last May 2024 at a car conference with my partner. I may not have classic cars, but I do have classic calculators. Here the programs I took with me in Casio fx-4000P.
I also took my HP 45 with me as well.


Total: 448 bytes out of 550 bytes ( ^ => x^y)


Prog 0: Quadratic Equation: Po Shen way: x^2 + B * x + C = 0, built for real roots (39 steps)


“ B “ : ? → B : “C” : ? → C : B² ÷ 4 – C → W ◢ -B ÷ 2 - √W ◢ Ans + 2 × √W


Prog 1: Law of Cosines - Side Z (45 steps)


Deg : “X” : ? → X : “Y” : ? → Y : “C” : ? → C : X² + Y² – 2 × X × Y × cos C : √Ans → Z


Prog 2: Law of Cosines - Angle C (49 steps)


Deg : “X” : ? → X : “Y” : ? → Y : “Z” : ? → Z : ( X² + Y² – Z² ) ÷ ( 2 × X × Y ) : cos^-1 Ans → C


Prog 3: Area of Triangle – Heron’s Formula (55 steps)


X” : ?→X : “Y” : ?→Y : “Z” : ?→Z : (X + Y + Z) ÷ 2→S : √( S×(S – X)×(S – Y)×(S – Z))


Prog 4: Speed of Sound in Dry Air (53 steps)

All constants, γ, R, M are taken care of in the formula, T = temp in °F

Conversions: 1 m/s = 2.236936 mph, 20.04503702 * 2.236936 = 44.83946493


T “ : ?→T : 5÷9 × (T – 32) + 273.15 : 20.04503702 * √Ans : 2.236936 * Ans → S


Prog 5: Horizontal Curve Analysis Given Central Angle and Radius (52 steps)

I = central angle, R = radius, L = arc length, C = chord length


Deg : “I” : ?→I : “R” : ?→R : “L=” ◢ π×R×I ÷ 180 → L ◢ “C=” ◢ 2×R× sin(I ÷ 2) → C


Prog 6: D = Displacement of a Cylinder (in) (36 steps)

B = bore (in), S = stroke (in), N = number of cylinders


“B” : ? → B : “S” : ? → S : “N” : ? → N : π × B² × S × N ÷ 4 → D


Prog 7: Tire Size (in) (36 steps)

S = section width (mm), A = aspect ratio, R = rim diameter (S, A, R → )


“S” : ? → S : “A” : ? → A : “R” : ? → R : S × A ÷ 1270 + R → T


Prog 8: Air Pressure for height up to 36,089 ft above sea level (inHg) (45 steps)

This is with constants already completed (g, M, R, etc.)


H” : ?→H : 29.92126 × (1 - 6.875 × 10^-6 × H) x^y 5.255876329 → P


Prog 9: Breaking Distance in Feet Given the Car’s Velocity in Miles Per Hour (35 steps)


V” : ? → V : V × 22 ÷ 15 : Ans × 1.5 + Ans² ÷ 45.04367 → D


Source:

“Breaking Distance” Wikipedia. Last Edited March 30, 2024. Accessed April 29, 2024.

https://en.wikipedia.org/wiki/Braking_distance


Hagberg Media AB. “Stopping distance = reca2tion distance + breaking distance” 2024.

Accessed April 29, 2024. https://korkortonline.se/en/theory/reaction-braking-stopping/


Just for fun,

Eddie


All original content copyright, © 2011-2024. 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, September 17, 2023

Filling the Memory of a Casio fx-4000P

Filling the Memory of a Casio fx-4000P





How many programs does it take to fill the 550 step memory?   Here are six programs that pretty much does the job.   I purposely aimed for descriptive prompts and messages. 


Spaces are added for readability.  


Here's are the six programs:


Prg 1:  Approximating the cumulative distribution function of the Normal Curve - to 3 decimal places


Mode +:  COMP,  Number of Steps: 82


"Z≥0" : ?→Z : Fix 3 : 1 - ((1+.196854 Z +.115194 Z² + .000344 Z^3 + .019527 Z^4)^ -4) ÷ 2 : Rnd : Norm : "AREA=" ◢ Ans → A


Source:  Abramowitz and Stegun, Handbook of Mathematical Functions. 1972.


Examples:


Z = 1.6

Results:  AREA = 0.945


Z = 1

Results:  AREA = 0.841


For best results, enter a positive Z.  



Prg 2:  Binomial Distribution PDF with Mean and Variance 


Mode +: COMP, Number of Steps: 86


"P(WIN)" : ?→P : "TRIALS" : ?→T : "WINS" : ?→N : "PDF=" ◢ T nCr N × P x^y N × (1-p) x^y (T-N) ◢ "MU=" ◢ T P  ◢ "VAR=" ◢ Ans (1 - P)


Note:  The combination function, nCr, is shown on the screen as a lone solid C.  I have the nCr for clarification.  


P(WIN):  probability of a successful event

TRIALS:  number of events

WINS:  number of successful events

PDF:  probability of we get the number of successful events

MU:  expected value, mean - depending on P(WIN) and TRIALS

VAR:  variance - depending on P(WIN) and TRIALS


Example:


P(WIN) = 0.7,  TRIALS = 25, WINS = 10

Results:  PDF = 1.324897424 x 10^-3, MU= 17.5, VAR= 5.25   



Prg 3:  Angles of a triangle given 3 side lengths in Degrees - Solve a SSS (side-side-side) Triangle


Mode +: COMP,  Number of Steps: 86


Deg : "A" : ?→A : "B" : ?→B : "C" : ?→C : "<A=" ◢ cos^-1 ((A² + B² - C²) ÷ (-2 B C))  → D ◢ "<B=" ◢ sin^-1(B sin D ÷ A) → E ◢ "<C=" ◢ 180-D-E→F 


Angle <A  (stored in D) is opposite of side with length A

Angle <B (stored in E) is opposite of side with length B

Angle <C (stored in F) is opposite of side with length C


Degrees mode is set in the program.  


Example:

Triangle with lengths A = 24, B = 60, C = 44

Results:  <A = 20.04997572,  <B = 58.99241697, <C = 100.9576073



Prg 4:   Free Fall with Air Resistance (from Ke!san)  

Assume coefficient is standard at k = 0.24 kg/m

(angle is not needed, hyperbolic trig does not depend on angle unit)


Site:  https://keisan.casio.com/exec/system/1231475371

(last retrieved:  February 27, 2023)


Mode +:  COMP,  Number of Steps:  88


.24 → K : 9.80665 → G : "MASS" : ?→M : "DIST" : ?→D : √(M ÷ G ÷ K) → X : "TIME=" ◢ 

X cosh^-1 (e(D K ÷ M)) → T ◢ "VEL=" ◢ X G tanh(T ÷ X) → V


SI units are assumed.


Example:

MASS = 68 kg, DIST (free fall distance) = 1874 m

Results:  TIME = 39.27745305 s, VEL (velocity at free fall) = 52.71191359 m/s



Prg 5:  Sums of 1 to n for k, k^2, k^3, and K^4


Mode +:  COMP, Number of Steps:  83


"1 TO..." : ?→N : "K =" ◢ N (N+1) ÷ 2 → S ◢ "K²=" ◢ S (2 N + 1) ÷ 3 → T ◢ 

"K◢3=" ◢ S² → U ◢ "K◢4=" ◢ T (3 N² + 3 N - 1) ÷ 5 → V 



The power character, x^y can not be used in a string or an error occurs.  The stop character, ◢, can be used.  


K:   Σ (K from K = 1 to K = N)

K²:  Σ (K^2 from K = 1 to K = N)

K◢3:  Σ (K^3 from K = 1 to K = N)

K◢4:  Σ (K^4 from K = 1 to K = N)


Example:  

N = 9

Results:

K:  45

K²:  285

K◢3:  2025

K◢4:  15333



Prg 6:  Simple Ohm's Law Wheel/Volts, Current, Resistance:  "PIE" chart


Mode +:  COMP, Number of Steps: 121


Lbl 0 : "ENT 0 TO SLV" ◢ "I" ◢ ?→I : "V" ◢ ?→ V : "R" ◢ ?→R : I=0 ⇒ Goto 1 : V=0 ⇒ Goto 2:  R=0 ⇒ Goto 3: Goto 0:  Lbl 1:  "I="  ◢ V ÷ R → I ◢ Goto 4: Lbl 2: "V=" ◢ I R → V ◢ Goto 4: Lbl 3: "R=" ◢ V ÷ I → R ◢ Lbl 4: "END"


I:  current (amps, A)

V: voltage (volts, V)

R:  resistance (ohms, Ω)


The inputs will be in this order.  Enter a zero for the variable you want to solve for.  


Examples:


Solve for I:  I = 0, V = 12, R = 3

Result:  I = 4


Solve for V:  I = 20, V = 0, R = 30

Result:  V = 600


Solve for R:  I = 17, V = 120, R = 0

Result:  R ≈ 7.05






Total Number of Programs: 6

Total Steps Used: 121 (I only have 4 left)


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. 


Friday, July 15, 2022

TI-58/TI-59 Week: Law of Cosines

TI-58/TI-59 Week:  Law of Cosines


Introduction


[ A ]:  stores either the angle θ or a 

[ B ]:  stores the length of side b

[ C ]:  stores the length of side c


[ D ]:  calculates the length of side a:

a^2 = b^2 + c^2 - 2 * b * c * cos θ


[ E ]:  calculates the angle θ

cos θ = (b^2 + c^2 - a^2) / (2 * b * c)


The angle θ is opposite slot of side a.


Program Listing


000 76 LBL

001 11 A

002 42 STO 

003 01 01

004 92 INV SBR (RTN)


005 76 LBL

006 12 B

007 42 STO

008 02 02

009 92 INV SBR


010 76 LBL

011 13 C

012 42 STO

013 03 03

014 92 INV SBR


015 76 LBL

016 14 D

017 43 RCL

018 02 02

019 33 x^2

020 85 +

021 43 RCL

022 03 03

023 33 x^2

024 75 -

025 02 2

026 65 ×

027 43 RCL

028 02 02

029 65 ×

030 43 RCL

031 03 03

032 65 ×

033 43 RCL

034 01 01

035 39 cos

036 95 =

037 34 √

038 42 STO 

039 04 04

040 INV SBR


041 76 LBL

042 15 E

043 53 (

044 43 RCL

045 02 02

046 33 x^2

047 85 +

048 43 RCL

049 03 03

050 33 x^2

051 75 -

052 43 RCL 

053 01 01

054 33 x^2

055 54 )

056 55 ÷

057 53 (

058 02 2

059 65 ×

060 43 RCL

061 02 02

062 65 ×

063 43 RCL

064 03 03

065 54 )

066 95 =

067 02 INV

068 39 cos  (arccos)

069 42 STO 

070 04 04

071 92 INV SBR


Examples


Calculating a:


Set the TI-58/TI-59 to Degrees mode:


Input:


50° [ A ]

45  [ B ]  (b)

35 [ C ] (c)

[ D ] returns a:  35.00312885


85° [ A ]

100  [ B ]  (b)

70 [ C ] (c)

[ D ] returns a:  116.9607609


Calculating θ:


52 [ A ]  (a)

38 [ B ] (b)

49 [ C ] (c)

[ E ] returns θ:  72.15813198


80 [ A ]  (a)

60 [ B ] (b)

65 [ C ] (c)

[ E ] returns θ:  79.47338145


Note:  The next post will be on July 23, 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. 


Sunday, November 22, 2020

Heron's Formula vs Area by Vertices

Heron's Formula vs Area by Vertices

There are several ways to determine the area of a triangle.

Heron's Formula:

With side lengths A, B, and C, the area is:

Area = √( S * (S - A) * (S - B) * (S - C) ) 

where S = (A + B + C) / 2

Area of Vertices:

With vertices (x1, y1), (x2, y2), and (x3, y3), the area is:

Area = 1/2 * abs( (x1 - x2) * (y1 + y2) + (x2 - x3) * (y2 + y3) + (x3 - x1) * (y3 + y1) )

Testing The Data






I ran a test of 50 randomly selected sets of three points that form the triangle.  The three points are:
*  The origin: (0,0)
*  The second point has 0 ≤ x ≤ 20 and -20 ≤ y ≤ 20, x and y are integers
*  The third point has 0 ≤ x ≤ 20 and 0 ≤ y ≤ 20, x and y are integers

I used the Casio fx-9750gIII Spreadsheet application.    

Casio Spreadsheet Set Up

Column Titles - Row 1:

Column A:  "X1"   x coordinate of point 1
Column B:  "Y1"   y coordinate of point 1
Column C:  "X2"   x coordinate of point 2. 
Column D:  "Y2"  y coordinate of point 2
Column E:  "X3"  x coordinate of point 3
Column F:  "Y3"  y coordinate of point 3
Column G:  "XY1"  distance between points 1 and 2
Column H:  "XY2"  distance between points 2 and 3
Column I:  "XY3"  distance between 3 and 1
Column J:  "S"   semi-perimeter of the triangle
Column K:  "HERON"  Area by Heron's Formula
Column L: "VERT"  Area by Vertices 
Column M:  "DIFF"  Difference between two calculation methods

Formulas for Rows 2 through 51

Column A:  A2 = Fill(0,50)
Column B:  B2 =Fill(0,50)
Column C:  C2 =Seq(Int(22 Ran#) - 1,X,1,50,1)
Column D:  D2 =Seq(Int(41 Ran#) - 21,X,1,50,1)
Column E:  E2 =Seq(Int(22 Ran#) - 1,X,1,50,1)
Column F:  F2 =Seq(Int(22 Ran#)-1, X,1,50,1)
Column G:  G2 Fill:  =√(C2^2 + D2^2) for range G2:G51*
Column H:  H2 Fill:  =√((C2-E2)^2 + (D2-F2)^2) for range H2:H51
Column I:  I2 Fill:  =√(E2^2 + F2^2) for range I2:I51*
Column J: J2  Fill:  =(G2 + H2 + I2) ÷ 2 for range J2:J51
Column K:  K2 Fill =√(J2 (J2 - G2) (J2 - H2) (J2 - I2) ) for range K2:K51
Column L:  L2 Fill =0.5 × Abs( (A2 - C2)(B2 + D2) + (C2 - E2)(D2 + F2) 
+ (E2 - A2)(F2 + B2)) for range L2: L51
Column M:  M2  Fill =K2-L2

 * To take advantage that the first point is (0, 0).  The full distance formula would be needed otherwise.  

This spreadsheet implies that there is no "rounding" the middle results.  


If you want to download the spreadsheet results, click here:


The zip file contains two images, a csv file, and a Casio spreadsheet file that can be ran on Casio calculators with a spreadsheet application. 

Of the sample taken, the areas determined by Heron's Formula and Area by Vertices are substantially equal; any difference is the order of 10^-12.

Happy Thanksgiving,

Eddie

All original content copyright, © 2011-2020.  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, October 11, 2020

Casio Classpad: Theorem of Sós

Casio Classpad:  Theorem of Sós


Introduction: The Theorem of Sós

A set of triple rational numbers (a, b, λ) is considered to be a H-triple if

c = √(a^2 - 2 λ a b + b^2) is also a rational number.  (I)


Heron Triple

Should the set of rational numbers (a, b, λ) can be further test to see if to is also a Heron triple.  That criteria (see source) requires for some numbers λ' and A (area):

λ' = √(1 - λ^2) is a positive rational number, and

A = λ' * abs(a * b) / 2 is a natural number  (positive integer)


This implies for all cases for Heron Triples that abs(λ) < 1, or -1 < λ < 1.

If the H-triple passes, then it becomes a Heron triple and the sides (a, b, c) (see (I) above) are the lengths of a Heron triangle.  

It is possible that an H-triple is not a Heron triple.  

Today's blog focuses on H-triples.  


Generating H-Triples

Given relatively prime integers m and n (where gcd(m,n) = 1) and μ, an H-triple can be generated by the following equations:


(II)

a = μ * (m^2 - n^2)

b = μ * (2*m * (n + λ*m))

c = μ * (m^2 + 2*λ*m*n + n^2)

For a > 0, this requires that m > n.  In the program htrigen, I assume that μ = 1.  In the program, u = λ

Casio Classpad Program:  htrigen

(fx-CP400 and fx-CG500)


'2020-09-15 EWS

'H Triple

Local a,b,c,m,n,u

Input m, "m > n", "m?"

Input n, "m > n", "n?"

Input u, "λ? (rational)"

If gcd(m,n)≠1

Then

Print "m and n are not"

Print "relatively prime."

Stop

IfEnd

(m^2 - n^2) ⇒ a

(2 × m × (n + u × m)) ⇒ b

(m^2 + 2 × u × m × n + n^2) ⇒ c

Print "H-Triple:", ColorMagenta

Print "{a,b,λ}="

Print {a,b,u}, ColorBlue

Print "c="

Print c


Example:

m = 7, n = 3, λ = 2/3


Result:

a = 40, b = 322/3, c = 86


Testing the Theorem of Sós


The program htrist tests the criteria for the triple (a, b, λ). 


Testing numbers in a program to see that they are rational is not as easy as it appears. Thankfully, the functions numerator and denominator can be used on the Classpad.  The numerator function converts the number into an exact fraction and extracts its numerator.  Similarly, the denominator function converts the number into an exact fraction and extracts its denominator.  


For an irrational number such as √2, the Classpad determines the exact fraction to be 

√2/1.


Casio Classpad Program:  htrist

(fx-CP400 and fx-CG500)


'2020-09-15 EWS

'H Triple test

Local a,b,c,n,d,u

Input a

Input b

Input u, "λ? (rational)"

√(a^2 - 2 × u × a × b + b^2) ⇒ c

numerator(c) ⇒ n

denominator(c) ⇒ d

ClrText

Print {n, d}

If frac(n) = 0 and frac(d) = 0

Then

Print "H Triple", ColorGreen

Print {a, b, u}

Print "c ="

Print c

Else 

Print "No Solution", ColorRed

IfEnd


Example:

a = 85, b = 374, λ = 1


Results: 

c = 289,  n = 289, d = 1


Source:


Halbeisen, Lorezn and Hungrebühler, Nobert.  "Heron triangles and their elliptic curves" Journal of Number Theory 213 (2020) 232-253.  https://doi.org/10.1016/j.jnt.2019.12.005 


Eddie


All original content copyright, © 2011-2020.  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, July 25, 2020

Fun with the 71B '20

Fun with the 71B '20

Differential Equations:  Runge Kutta Method 4th Order

Find a numerical solution to the differential equation:

dy/dx = f(x, y)

x is the independent variable, y is the dependent variable.  You define f(x,y) on line 10.   For example, dy/dx = sin(x * y) should have this as line 10:

10 DEF FNF(X,Y) = SIN(X*Y)

Line 5 is a remark line.  Remarks are followed by exclamation points on the HP 71B.

HP 71B Program: RK4 

Size: About 300 - 330 bytes

5 ! FNF(X,Y) = dY/dX
10 DEF FNF(X,Y) = [ insert f(x,y) here ]
15 DESTROY X,Y,H,K1,K2,K3,K4
20 INPUT "X0? "; X
25 INPUT "Y0? "; Y
30 INPUT "STEP? "; H
40 K1 = FNF(X,Y)
45 K2 = FNF(X+H/2,Y+H*K1/2)
50 K3 = FNF(X+H/2,Y+H*K2/2)
55 K4 = FNF(X+H,Y+H*K3)
60 X=X+H
65 Y=Y+H*(K1+2*K2+2*K3+K4)/6
80 DISP "(";X;",";Y;")" @ PAUSE
85 DISP "NEXT? Y/N"
90 A$=KEY$
95 IF A$="Y" THEN 40
99 IF A$="N" THEN DISP "DONE" @ END ELSE 85

Example:
dy/dx = sin(x * y) with inital condition y(0) = 0.5,  h = 0.2 * π

First three results:
( .628318530718 , .607747199386 )   ( [ f ] [ +] (CONT), [ Y ] )
( 1.25663706144, 1.02432288082 )
( 1.88495559216, 1.51038862362 ) 

Hyperbolic Functions

[ S ] = sinh(x)
[ C ] = cosh(x)
[ A ] = asinh(x)
[ H ] = acosh(x)
[ X ]  to exit

HP 71B Program: HYP

Size:  401 bytes
acosh(x) requires that | x | ≥ 1

100 DESTROY A,X
115 DISP "sinh S/A, cosh C/H, X"
120 A$=KEY$
125 IF A$="S" THEN INPUT "X? ";X @ CALL SINH(X)
130 IF A$="C" THEN INPUT "X? ";X @ CALL COSH(X)
135 IF A$="A" THEN INPUT "X? ";X @ CALL ASINH(X)
140 IF A$="H" THEN INPUT "X? ";X @ CALL ACOSH(X)
145 IF A$="X" THEN 150 ELSE 115
150 DISP "DONE" @ END
200 SUB SINH(X)
205 DISP (EXP(X)-EXP(-X))/2 @ PAUSE
210 END SUB
300 SUB COSH(X)
305 DISP (EXP(X)+EXP(-X))/2 @ PAUSE
310 END SUB
400 SUB ASINH(X)
405 DISP LOG(X+SQR(X^2+1)) @ PAUSE
410 END SUB
500 SUB ACOSH(X)
510 DISP LOG(X+SQR(X^2-1)) @ PAUSE
515 END SUB

Example:
X = 2.86

sinh(2.86) returns 8.70212908815
cosh (2.86) returns 8.75939784845
asinh(2.86) returns 1.77321957441
acosh(2.86) returns  1.71190019325

Arithmetic-Geometric Mean

The arithmetic-geometric mean (AGM) is found by the iterative process:

a = 0.5 * (x + y)
g = √(x * y)

The values of a and g are stored into x and y, respectively.  The process repeats until the values of a and g converge.   A tolerance of 10^(-9) is used to display an 8-digit approximation.

HP 71B Program: AGM

Size:  148 Bytes

10 DESTROY X,Y,A,B
15 DISP "AGM(X,Y)" @ WAIT .5
20 INPUT "X? ";X
25 INPUT "Y? ";Y
30 A=.5*(X+Y)
35 G=SQR(X*Y)
40 X=A
45 Y=G
50 IF ABS(X-Y)>1E-9 THEN 30
55 DISP USING 60;X
60 IMAGE 10D.8D    // (10 digit integer parts with rounding to 8 decimal places)
65 END

Example:
AGM(178, 136)

Result:  156.29380544

Pythagorean Triple Generator

Given two positive integers m, n; where m > n, a Pythagorean triple is generated with the following calculations:

a = 2*m*n
b = m^2 - n^2
c = m^2 + n^2

Properties:

a^2 + b^2 = c^2
Perimeter: p = a + b + c
Area: r = a * b / 2

HP 71B Program: PYTHTRI

Size: 217 bytes

10 DESTROY M,N,A,B,C,R,P
20 DISP "M>N, INTEGERS" @ WAIT .5
25 INPUT "M? "; M
30 INPUT "N? "; N
35 A=2*M*N
40 B=M^2-N^2
45 C=M^2+N^2
50 P=A+B+C
55 R=A*B/2
60 DISP 'A = ';A @ PAUSE
65 DISP 'B = ';B @ PAUSE
70 DISP 'C = ';C @ PAUSE
75 DISP 'PERIM.=';P @ PAUSE
80 DISP 'AREA =';R
85 END

Example:
M = 16, N = 11

Results:
A = 352, B = 153, C = 377, P = 864, R = 23760

Impedance of An Alternating Current

The program ALTCURR calculates the impedance (magnitude and phase angle) of a sinusoidal alternating current consisting of one resistor, one capacitor, and one inductor in a series.

HP 71B Program: ALTCURR

Size: 210 bytes

10 DESTROY F,L,C, R,W,Z,T
15 DEGREES
20 INPUT "FREQUENCY? ";F
25 INPUT "INDUCTANCE? ";L
30 INPUT "CAPACITANCE? ";C
35 INPUT "RESISTANCE? ";R
40 W=2*PI*F
45 Z=SQR(R^2+(W*L-1/(W*C))^2)
50 T=ATAN((W*L-1/(W*C))/R)
55 DISP "MAGNITUDE= "; Z @ PAUSE
60 DISP "PHASE ANGLE = "; T

Example:
F = 152 Hz
L = 4.75E-3 H  (4.75 mH)
C = 8E-6 F  (8 μF)
R = 6400 Ω

Results: 
Magnitude:  6401.24704262
Phase Angle: -1.1309750812°

Source:
Rosenstein, Morton.  Computing With the Scientific Calculator Casio.  Japan. 1986.  ISBN 1124161430


Eddie

All original content copyright, © 2011-2020.  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.

Friday, November 6, 2015

HP Prime Geometry App Tutorial Part 2: Triangles

HP Prime Geometry App Tutorial Part 2:  Triangles

Like Part 1, we’ll use a Plot window of XRange = [ -16, 16 ], YRange = [ -11, 10.9 ], ticks are at 1.  For this lesson, we are going to focus on triangles.  Start with a clear Plot Screen ([Shift], [ Esc ] (Clear)).

Drawing a Triangle

1.  On the plot screen, press the soft key (Cmds), then select 4 for Polygon and 1 for Triangle. 
2.  Select the first vertex (corner point) and press [ Enter ].  For this lesson, put the triangle wherever you want.
3.  Place the second and third vertex.  Press [ Enter ] after each point.  The vertices are labeled A, B, and C. 



Finding an Angle

The steps will demonstrate how to find the angle.  Be aware that the direction you enter the vertexes will determine the sign of the angle. 

1.  Press (Cmds), 9 for Measure, 6 for Angle.
2.  Select one vertex, press [Enter].  Follow the triangle to select the second vertex (where the angle will be measured), press [ Enter ].  Follow that with a third vertex and press [Enter].  The angle displayed on top of the screen.



Resizing the Triangle

Click on one of the points of the points.  Then drag the point with the arrow pad.  When satisfied, press [ Enter ].



For the last part, clear the screen.

Reflect a Triangle – reflect about a point

1.  Clear the screen.  ([ Shift ] [ Esc ] (Clear))
2.  Draw a triangle with the vertices (-6, -4), (-6, 4), and (-12, 0).
3.  Press (Cmds), 7 for Transform, 2 for Reflection.
4.  You will be promoted for a reflection point.  For this exercise, set the point at (0,0). 
5.  Select the triangle (scroll until the triangle turns red) and press [ Enter ].



In Part 3, we’re going to work with lines and line segments.  Until next time, have a great day!

Eddie


This blog is property of Edward Shore.  2015.




Sunday, June 2, 2013

HP 35S: Planar Triangles

This program is set to solve common problems in plane (regular) triangles.

The programs can be adapted to any side lengths and angles necessary.

Variables of Plane Triangles

Side length a with corresponding angle A,
Side length b with corresponding angle B, and
Side length c with corresponding angle C.

Labels and Stack Set Up: HP 35S

Angle-Angle-Side, Label P001, Stack: B, A, b, Goal: a

Side-Side-Angle, Label P009, Stack: b, a, B, Goal: A

Angle-Side-Angle, Label P015, Stack: b, A, c, Goal: a

Side-Side-Side, Label P033, Stack: a, b, c, Goal: A (angle corresponding to first side length entered)

* If you use a 15C, 32Sii, or other another RPN calculator, you will need to create four labels. The nice thing with the HP 35S is that you can create multiple programs within in one label. Memory registers B and C are temporary.

Program P (Planar Triangles)

\\ Angle-Angle-Side: Law of Sines
\\ Stack: B, A, b; Find: a

P001 LBL P
P002 x<>y
P003 SIN
P004 ×
P005 x<>y
P006 SIN
P007 ÷
P008 RTN

\\ Side-Side-Angle: Law of Sines
\\ Stack: b, a, B; Find: A
P009 SIN
P010 ×
P011 x<>y
P012 ÷
P013 ASIN
P014 RTN

\\ Side-Angle-Side: Law of Cosines
\\ Stack: b, A, c; Find: a
P015 STO C
P016 x<>y
P017 COS
P018 ×
P019 x<>y
P020 STO B
P021 ×
P022 2
P023 ×
P024 +/-
P025 RCL B
P026 x^2
P027 +
P028 RCL C
P029 x^2
P030 +
P031 √
P032 RTN

\\ Side-Side-Side: Law of Cosines
\\ Stack: a, b, c; Find: A
P033 STO C
P034 x^2
P035 x<>y
P036 STO B
P037 x^2
P038 +
P039 x<>y
P040 x^2
P041 -
P042 2
P043 ÷
P044 RCL÷ B
P045 RCL÷ C
P046 ACOS
P047 RTN


Examples (Degrees Mode Used):
AAS: B = 30, A = 40, b = 4; a ≈ 5.1423

SSA: b = 5, a = 4, B = 90°; A ≈ 53.1301°

SAS: b = 8, A= 30°, c = 9; a ≈ 4.5047

SSS: a = 5, b = 4, c = 3; A = 90°


Hope this helps. I plan to post a program regarding spherical triangles.

Take care,

Eddie


This blog is property of Edward Shore. 2013

Python – Earth’s Radius and Gravity in US Units

Python – Earth’s Radius and Gravity in US Units Introduction The following script, gravus2.py, estimates the Earth’s gravity i...