Thursday, May 16, 2019

Casio fx-CG50 and HP Prime: Azimuth/Bearing Conversions

Casio fx-CG50 and HP Prime: Azimuth/Bearing Conversions

Introduction




The programs A2B (Azimuth to Bearing) and B2A (Bearing to Azimuth) convert angles between two measuring systems that are commonly used by civil engineers and navigators.

The program uses an unusual approach: the use of the arcsine, sine, and cosine functions.   These functions are used on because on scientific calculators, the trigonometric functions return answers in specific ranges.

Let x be a real number.  then:

asin(x) returns answers in the range -90° to 90°  (-π/2 to π/2 radians)

acos(x) returns answers in the range 0° to 180°  (0 to π radians)

atan(x) returns answers in the range -90° to 90°  (-π/2 to π/2 radians)

This was used in the HP 33E program from the calculator book "HP 33E: Surveying Applications".  See Source below.

Formulas:

A = azimuth
B = bearing
Q = quadrant  (1,2,3,4)

Azimuth to Bearing:

B = abs( asin( sin A ) )
Q = int(A/90 + 1)

(Yes, the asin/sin is there for a purpose: to get an angle in the range of -90° to 90°)

Bearing to Azimuth:

A = 180° * int(Q/2) - B * cos(Q * 180°)

In the programs A2B and B2A, both input and output will be degrees-minutes-seconds format.

To enter degrees-minutes-seconds:

Casio fx-CG50:  [ OPTN ] [ F6 ] (more) [ F5 ] (ANGLE)  [ F4 ] (° ' ")

HP Prime:  [ Shift ] [ a b/c ] or [ Shift ] [ 9 ] (select °, ', or '' from the menu)

Azimuth to Bearing Program A2B

Casio fx-CG50 Program A2B (Azimuth to Bearing)

ClrText
Locate 1,4,"AZIMUTH TO BEARING"
Deg
"AZ: "? → A
Abs( sin^-1 ( sin A ) ) → B
"BEARING ="
B ▶ DMS ◢
Intg( A ÷ 90 + 1 ) → Q
"QUADRANT = "
Q = 1 ⇒ "NE"
Q = 2 ⇒ "SE"
Q = 3 ⇒ "SW"
Q = 4 ⇒ "NW"

HP Prime Program A2B (Azimuth to Bearing)

EXPORT A2B(A)
BEGIN
// Azimuth to Bearing
HAngle:=1;  // Degrees
LOCAL B, Q, L0:={"NE","SE","SW","NW"};
B:=ABS(ASIN(SIN(A)));
Q:=IP(A/90+1);
RETURN { →HMS(B), L0(Q) }
END;

Example 1:  220° 15' 36"
Result:  40°15'36". SW

Example 2:  184°00'14"
Result: 4°00'14"  SW

Bearing to Azimuth Program B2A

Casio fx-CG50 Program B2A  (Bearing to Azimuth) 

ClrText
Locate 1,4,"BEARING TO AZIMUTH"
Deg
"BEARING: "? → B
Menu "QUADRANT", "NE", 1, "SE", 2, "SW", 3, "NW", 4
Lbl 1: 1 → Q: Goto 5
Lbl 2: 2 → Q: Goto 5
Lbl 3: 3 → Q: Goto 5
Lbl 4: 4 → Q: Goto 5
Lbl 5
180 * Intg( Q ÷ 2 ) - B * cos( Q * 180 ) → A
"AZ ="
A ▶ DMS

HP Prime Program B2A (Bearing to Azimuth)

Arguments:  Bearing, Quadrant.  You can enter Quadrant by a string or numerical quadrant.  "NE" = 1,  "SE" = 2,  "SW" = 3, "NW" = 4

EXPORT B2A(B,q)
BEGIN
// Bearing to Azimuth
// q "NE", "SE", "SW", "NW"
// or 1,2,3,4
LOCAL A, L0:={"NE","SE","SW","NW"};
HAngle:=1;  // Degrees
// deal with strings
IF TYPE(q)==2 THEN
q:=POS(L0,q);
END;
A:= 180 * IP(q/2) - B * cos(q * 180);
RETURN →HMS(A);
END;

Example 3:  43°21'55"  SW (q = 3)
Result:  223°21'55"

Example 4:  13°14'56"  SE (q = 2)
Result:  166°45'04"

Source:

Hewlett Packard.  "HP33E:  Surveying Applications"  Hewlett Packard Company.  March 1978

Eddie

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

Monday, May 13, 2019

HP 42S/DM42/Free42: Room Cavity Ratio, Luminous Intensity and Illuminance

HP 42S/DM42/Free42:  Room Cavity Ratio, Luminous Intensity and Illuminance

Room Cavity Ratio



The room cavity ratio is used to assist in calculating lighting efficiency in determining where to place ceiling lights in an office room.  The formula is:

RCR = INT( ( 5 * H * ( L + W ) ) / ( L * W ) )

where:
L = length of the room
H = height difference between floor cavity and ceiling cavity
W = width of the room

HP 42S/DM42/Free42:  Solver RCR

LBL "RCR"
MVAR "H"
MVAR "L"
MVAR "W"
MVAR "RCR"
5
RCL * "H"
RCL "L"
RCL + "W"
*
RCL "L"
RCL * "W"
÷
IP
RCL - "RCR"
END

Examples

Example 1: 
Input:  H = 5.5, L = 16.8, W = 13.7.   Result:  RCR = 3

Example 2:
Input: H = 5.5, L = 16.8, RCR = 4.  Result:  H = 7.1650

Sources:

Dilouie, Craig.  "Lighting Design:  Example of Role Surfaces Play in Lighting Efficiency"  LightNOW  https://www.lightnowblog.com/2010/06/example-of-role-surfaces-play-in-lighting-efficiency/  June 16, 2010.  Retrieved March 31, 2019

"Room Cavity Ratio, RCR" Illuminating Engineering Society.  https://www.ies.org/definitions/room-cavity-ratio-rcr/  July 5, 2018.  Retrieved April 28, 2019

Luminous Intensity and Illuminance

The follow equation relates the luminous intensity (measured in candelas, cd) and illuminance (measured in lux) of a light source.  The equation assumes the light source radiates a spherical matter. 

E = I / R^2

E = illuminance
I = luminous intensity
R = radius of the sphere's light (meters)

HP 42S/DM42/Free42:  Solver ILSPH

LBL "ILSPH"
MVAR "E"
MVAR "I"
MVAR "R"
RCL "E"
RCL "I"
RCL "R"
x ↑ 2
÷
-
END

Examples

Example 1:
Input:  I = 10 cd, R = 2 m.  Result:  2.5 lux

Example 2:
Input:  R = 3.65 m, E = 30 lux.  Result:  I = 399.6750 cd

Sources:

Daryanani, Sital  Building Systems Design With Programmable Calculators Architectural Record Books.  McGraw-Hill Book Company: New York.  1980.  ISBN 0-07-015415-5

Zumtobel "The Lighting Handbook" Zumtobel Lighting GmbH.  Dornbirn, Austria.  6th Edition: 2018  https://www.zumtobel.com/PDB/Ressource/teaser/en/Lichthandbuch.pdf

Eddie

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

Casio Calculators and the Percent Key

Casio Calculators and the Percent Key

Introduction

The percent function on Casio calculators varies based on the calculator itself.  Let's compare six key algorithms on six Casio calculators, five current and one from the past.  We will go from the most consistent behavior to the least.

The calculators used in this study are:

SL-300VC  (four function calculator)
fx-260 Solar II  (scientific calculator - one line display)
fx-300MS 2nd Edition (scientific calculator - one line display)
fx-115ES Plus  (scientific calculator - textbook display)
fx-991EX Classwiz (scientific calculator - textbook display)
fx-115D  (scientific calculator introduced in 1991 - one line display)

Let A and B be real numbers.  In the following examples, required press of the [SHIFT] key are implied as required. 

Algorithm 1:  Multiply

Keystrokes:  A [ × ] B [ % ]

Let A = 82, B = 30

SL-300VC:  24.6 
fx-260 Solar II:  24.6
fx-300MS 2nd Edition:  24.6
fx-115ES Plus**:  123/5 ([ S<>D] 24.6) 
fx-991EX Classwiz**:  123/5  ( [ S<>D] 24.6)
fx-115D:  24.6

A [ × ] B  [ % ] calculates A * B/100.  No surprise that the results will be consistent across the board. 

**Pressing equals ( [ = ] ) is required to complete calculations involving percent calculations for the calculators with textbook display. 

Algorithm 2:  Division

Keystrokes:  A [ ÷ ] B [ % ]

Let A = 82, B = 30

SL-300VC:  273.33333 
fx-260 Solar II:  273.3333333
fx-300MS 2nd Edition:  273.3333333
fx-115ES Plus:  820/3 ([S <> D] 273.3333333) 
fx-991EX Classwiz:  820/3 ([S <> D] 273.3333333)
fx-115D: 273.3333333

A [ ÷ ] B calculates A  * 100/B.   Results are consistent across the board.

Algorithm 3:  Adding Percents

Keystrokes:  A [ × ] B [ % ] [ + ]  

A = 57, B = 11

SL-300VC: 63.27 
fx-260 Solar II: 63.27
fx-300MS 2nd Edition:  63.27
fx-115D:  63.27 

This calculates A * (1 + B/100)

If you tried the exact algorithm with the textbook style calculators like the fx-115ES Plus and the fx-991EX Classwiz, you get an error.  Use the following instead:   A [ (  ] 1 [ +  ] B [ % ] [  ) ] [ = ]

Algorithm 4:  Subtracting Percents

Keystrokes:  A [ - ] B [ % ] [ + ] 

A = 57, B = 11

SL-300VC: 50.73
fx-260 Solar II: 50.73
fx-300MS 2nd Edition:  50.73
fx-115D:  50.73 

This calculates A * (1 - B/100)

If you tried the exact algorithm with the textbook style calculators like the fx-115ES Plus and the fx-991EX Classwiz, you get an error.  Use the following keystroke algorithm instead:   A [ (  ] 1 [ -  ] B [ % ] [  ) ] [ = ]

Algorithm 5:  A - B%

Keystrokes:  A [ - ] B [ % ]

SL-300VC: 12.5 
fx-260 Solar II: 12.5
fx-300MS 2nd Edition: 12.5
fx-115ES Plus:  1784/25 ( [S<>D] 71.36) 
fx-991EX Classwiz:  1784/25 ( [S<>D] 71.36) 
fx-115D: 12.5

We see some difference on how this algorithm is calculated and it depends on the type of calculator used.

For four-function basic calculators and one-line scientific calculators, A - B% calculates the percent change:  (A - B)/B * 100

For the  textbook display calculators, the B is merely divided by 100 and subtracted from A:  A - B/100

Algorithm 6:  A + B%

Keystrokes:  A [ + ] B [ % ]

SL-300VC: 200
fx-260 Solar II: 300
fx-300MS 2nd Edition: 300
fx-115ES Plus:  201/2 ( [S<>D] 100.5) 
fx-991EX Classwiz:  201/2 ( [S<>D] 100.5) 
fx-115D: 300

This is the most inconsistent.  Quite honestly, I don't recommend this algorithm. 

What I learned:

1.  Check your manual on how to use the percent function ( % ), not matter what calculator you use. 

2.  Calculators with textbook display, the percent function ( % ) merely divides the argument by 100.

3.  This is an sample of six calculators, and as you can see, your mileage may vary. 

Have fun calculating,

Eddie

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

Thursday, May 9, 2019

Review: Casio fx-300MS 2nd Edition

Review:  Casio fx-300MS 2nd Edition





General Information

Company:  Casio
Type:  Scientific - Algebra (Perfect Algebra Method)
Display: 10 digits with 2 digit exponents
Power:  Solar with battery backup (LR-44)
Memory Registers:  8: A, B, C, D, E, F, X, Y, M
Years In Production: 2019 - present
Cost:  $10 - $20 (CVS sells this for $21, the only place in Southern California that carries the fx-300MS 2nd Edition - for now (as of 4/26/2019))
Documentation:  Manual, can be found online

Also known as:  fx-85MS 2nd Edition

Quick Overview of the Features

*  Trigonometry, Exponential, Logarithms
*  Factorial (of positive integers up to 69), Combinations, Permutations
*  Evaluating Algebraic Expressions up to 79 Characters
*  Memory Arithmetic with M  (M+ and M-)
*  Multi-statement analysis (connected by a colon  ( : ))
*  Statistics including six regressions:  Linear, Logarithm, Exponential, Power, Inverse, Quadratic
*  Fractions: Simplification, conversion between mixed and improper
* Contrast setting
* Two line display: the top line is for the expression and the bottom line is displays the answer

Function wise, the fx-300MS 2nd Edition is the same as the original edition of the fx-300MS and fx-85WA.  For my review on the Casio fx-85WA, click here:     http://edspi31415.blogspot.com/2019/01/retro-review-casio-fx-85wa.html

What is Different of the Second Edition?

Left:  fx-300MS,  Right:  fx-300MS 2nd Edition 


Last year, Casio introduced its revamped MS series with the goal of redesigning the calculator series. 

The MS loses its curvy shape in favor of a rounded box design, which is made to feel more comfortable when operating in the calculator in the hand. I favor this design as the 2nd Edition feels more comfortable in the hand. 

Close up of the numeric keys:  Left:  fx-300MS Plus, Right:  fx-300MS Plus 2nd Edition

The fonts on the keys are larger and the keys have better font-background ratio, which results in the keys being more readable.  The number keys are bigger hand have a charcoal black background instead of a gray background. 

The arrow keyboard is replaced with four separate arrow keys.  Instead of four rounded keys for [SHIFT], [ALPHA],[MODE], and [CLEAR], the keys are circular.  The exponent key [ EXP ] has been replaced with [ x10^x ], a trend with Casio scientific and graphing calculators.

I like the feel of the keys on the 2nd Edition a lot better than the previous edition, the keys feel more firm and steady to the touch. 

The display is similar to the previous edition, except that it is more sensitive to the touch.  Just be careful when you are handling the calculator near the display. 

Slide Case for the fx-300MS 2nd Edition

I don't know if this is first, but the MS series slide case is designed to attach and detach in two ways, so no matter where the top of the calculator is pointed, the case will fit on.  This is a really neat feature which I assume that Casio is going to continue when producing future scientific calculators. 

Verdict

I like the keyboards of the 2nd Edition MS series, the calculators look more high-tech, the keyboard is firmer,  and I love the large font on the keys.  I am now looking to get the fx-991 MS 2nd Edition.  That said, if you have the original edition, there really isn't a need to trade it or be rid of it, the original edition is still adequate for use. 

I guess it boils down to a matter of preference.  If you want the 2nd Edition and can find one (especially in the United States, I may have to go online for the fx-991 MS 2nd Edition), go for it. 

Happy calculating,

Eddie

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



Monday, May 6, 2019

HP Prime and HP 42S/DM42/Free42: Length of V Belts Solver

HP Prime and HP 42S/DM42/Free42:  Length of V Belts Solver

Introduction



The following equation relates the length of a V belt, the center to center distance between two pulleys or sheaves:

L = 2 * C + 1.57 * (D + d) + (D - d)^2/(4 * C)

where:

L = length of the V belt, the belt that wraps around two pulleys (or sheaves)
C = center to center distance
D = diameter of the large pulley/sheave
d = diameter of the small pulley/sheave

HP Program VBELT

This program creates four global variables:

beltlength = L
centerdist = C
lrgpulley = D
smpulley = d

The program then takes you to the Num page of the Solve app.  This allows us to create descriptive variables to help us in the Solve app. 

Global variables are created outside the main program.

// create global variables
// outside the main program
EXPORT beltlength;
EXPORT centerdist;
EXPORT lrgpulley;
EXPORT smpulley;


EXPORT VBELT()
BEGIN
// 2019-04-28 EWS

STARTAPP("Solve");

// uncheck E0-E9
LOCAL k;
FOR k FROM 0 TO 9 DO
Solve.UNCHECK(k);
END;

// enter equation to E1
E1:="beltlength=2*centerdist+
1.57*(lrgpulley+smpulley)+
(lrgpulley-smpulley)^2/
(4*centerdist)";
Solve.CHECK(1);

// go to Num View
STARTVIEW(2);

END;

HP 42S/DM42/Free 42 Solver Program VBELT

Use the SOLVER function win calling VBELT. 

LPULLEY:  large pulley/sheave diameter
SPULLEY: small pulley/sheave diameter

LBL "VBELT"
MVAR "LENGTH"
MVAR "CENTER"
MVAR "LPULLEY"
MVAR "SPULLEY"
2
RCL * "CENTER"
RCL "LPULLEY"
RCL + "SPULLEY"
1.57
*
+
RCL "LPULLEY"
RCL - "SPULLEY"
X ↑ 2

÷
RCL ÷ "CENTER"
+
RCL - "LENGTH"
END

Examples

Example 1:
Large Pulley Diameter = 1 in
Small Pulley Diameter = 3/4 in
Center to Center Distance = 1.5 in
Result:  V Belt Length ≈ 5.7579 in

Example 2:
Large Pulley Diameter = 1 in
Small Pulley Diameter = 7/16 in
V Belt Length = 6.24 in
Result: Center to Center Distance ≈ 1.975 in

Source:

Gladstone, John Air Conditioning Testing and Balancing: A Field Practice Manual Van Nostrand Reinhold Company: New York.  1974  ISBN 0-442-22703-5

Eddie

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

Thursday, May 2, 2019

HP Prime and Casio fx-CG50 MicroPython: √(x + √(x + √(x + ... )))

HP Prime and Casio fx-CG50 MicroPython:  √(x + √(x + √(x + ...  )))

Introduction

Made with LibreOffice Math


The program SQRADD attempts to find a calculation to:

√(x + √(x + √(x + ...  )))

That is:

1.  Start with a number x  (any positive number, we're assuming that we are in the Real Number domain)
2.  Take the square root
3.  Add x to the result
4.  Take the square root of the result
5.  Repeat steps 3 and 4 forever. (or until a condition is satisfied, such as machine accuracy is reached)


HP Prime Program SQRADD

The loop repeats until the difference between two terms is less than machine accuracy, 1E-12 (since HP Prime has floating point accuracy of 12 digits).  Output:  {x, answer, number of iterations it took to get machine accuracy}

EXPORT SQRADD(X)
BEGIN
// 2019-04-28 EWS
// √(X+√(X+√(X+...)))

// setup
LOCAL T,U,N:=1;
T:=√X;
U:=√(X+T);

// loop
WHILE ABS(U-T)≥1E−12 DO
T:=U;
U:=√(X+T);
N:=N+1;
END;

// display results {X,U,N}
RETURN {X,U,N};
END;

Casio fx-CG50 MicroPython Script sqradd.py

Use the Python mode of the Casio fx-CG50 (software versions 3.2 or greater).  For more information of this procedure, please see: http://edspi31415.blogspot.com/2018/10/casio-fx-cg50-version-320-python-comes.html

# 2019-04-28 EWS

import math

# sqrt(X+sqrt(X+...))
# declare variables
# as float
N=1.0
X=float(input("X="))
T=float(math.sqrt(X))
U=float(math.sqrt(X+T))

# loop
# Casio Micropython
# has precision of 15
while abs(U-T)>=1e-15:
  T=U
  U=math.sqrt(X+T)
  N+=1

# results
print("X= "+str(X))
print("Result= ")
print(str(U))
print("Iterations= "+str(N))

Procedure on a Four-Function or Desktop Calculator

1.  Clear the memory (usually [ MRC ] [ MRC ] )
2.  Enter x and store it in memory  (x  [ M+ ] )
3.  Take the square root [ √ ]
4.  Repeat this loop (until machine accuracy is reached, that is, the the result doesn't "change"):  [ + ] [ MR ] [ = ] [ √ ]

Results

HP Prime

x = 1,  Result:  1.61803398875, 23 iterations
x = 2, Result:  2,  20 iterations
x = 3,  Result: 2.30277563773, 18 iterations
x = 4, Result: 2.56155281281, 17 iterations
x = 5, Result: 2.79128784748, 17 iterations
x = 6, Result: 3,  16 iterations
x = 7, Result: 3.19258240357, 16 iterations
x = 8, Result: 3.37228132327, 15 iterations
x = 9, Result:  3.54138126514, 14 iterations
x = 10, Result: 3.70156211871, 14 iterations
x = 11, Result: 3.85410196624, 13 iterations
x = 12, Result: 4,  14 iterations
x = 20, Result: 5, 12 iterations
x = 30, Result: 6, 12 iterations
x = 42, Result: 7, 11 iterations
x = 56, Result: 8, 11 iterations

Casio fx-CG50 MicroPython

x = 1, Result:  1.618033988749895, 30 iterations
x = 2, Result: 2,  26 iterations
x = 3, Result: 2.302775637731994, 24 iterations
x = 4, Result: 2.56155281280883, 22 iterations
x = 5, Result: 2.79128784747792, 21 iterations
x = 6, Result: 3, 20 iterations
x = 7, Result: 3.192582403567252, 20 iterations
x = 8, Result: 3.372281323269014, 19 iterations
x = 9, Result: 3.54138126514911, 19 iterations
x = 10, Result: 3.701562118716424, 18 iterations
x = 11, Result: 3.854101966249685, 18 iterations
x = 12, Result: 4, 18 iterations
x = 20, Result: 5, 16 iterations
x = 30, Result: 6, 15 iterations
x = 42, Result: 7, 14 iterations
x = 56, Result: 8, 14 iterations

Some Interesting Observations

When x = 1, the result is the Golden Ratio, Φ = (1 + √5)/2.

When x = n * (n-1) where n is an integer and n ≥ 2, the result is n. 

Examples: 
x = 2 =  2 * 1, result: 2
x = 12 = 4 * 3, result: 4
x = 56  = 8 * 7, result: 8
x = 240 = 16 * 15, result: 16
x = 992 = 32 * 31, result:  32

Fun stuff.  What other patterns can we find with this or other similar calculation?  Until next time,

Eddie

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

Monday, April 29, 2019

Four Function and Desktop Calculators: The [ TAX+ ] and [ TAX- ] Keys

Four Function and Desktop Calculators: The [ TAX+ ] and [ TAX- ] Keys

A good subject for a Monday (start off the work week for most of us, me included)

The TAX+ and TAX- keys up close and personal  (Casio SL-300VC)


What is needed:  a calculator with [ TAX+ ] and [ TAX- ]

Introduction

On a four function or desktop calculator with the [ TAX+ ] and [ TAX- ] keys, you can perform tax calculations and financial calculations.  The primary key purpose of these keys is for sales tax.  The procedure for these calculations are (almost) universal.  However, the procedure to set such tax varies by manufacturer.

Casio:  Hold [AC] until the display blanks and refreshes.  Enter the tax rate and press [ % ] (RATE SET). 

Texas Instruments (TI-1795SV):   Enter the tax rate, press [ rate ], [ tax+ ] (store)

Canon:  Press [AC], [ TAX+ ] (SET), enter the rate, and press [ TAX+ ]

Sharp: Press [ CE/C ], [ CE/C ] (twice), [ TAX+ ], enter the rate, press [ TAX+ ]

Printing Calculators (various):  Set tax setting switch to SET, enter the rate, set the tax setting switch back to calculator mode.  Check your manual because printing calculators may vary.

My focus will be on four function and desktop calculators.  Procedures for printing calculators will probably vary.

Note:  I did the procedures listed in today's blog entry on both the Casio SL-300VC and Casio LS-123K.  For using independent memory, check to see if you have either a combined memory recall/clear key [MRC] (or [RM/CM on the LS-123K) or two separate keys ([MR] for recall and [MC] for clear).  For illustration purposes I will use [MRC]  (once for recall, twice for clear).   Remember that you can press [AC] to clear memory. 

Left:  Canon LS-123K (Green), Right:  Casio SL-300VC (Blue)


Note:  Pressing [AC] or [MRC] [MRC] will only clear the memory register, not the tax rate.

Contents

1.  Testing What Tax Rate is Stored in Memory
2. Price After Sales Tax and the Amount of Tax
3. Adding Taxable and Non-taxable Amounts
4. Calculating Use Tax
5.  Find the Taxable Amount Given the Grand Total (Total Plus Tax)
6.  Finance: Using [ TAX+ ] to calculate Future Value
7.  Finance: Using [ TAX- ] to calculate Present Value

For all the examples today, I have the tax rate set to 9.5%.  Please see the Introduction section above on how to set the tax rate.

1.  Testing What Tax Rate is Stored in Memory

This procedure is for any calculator that does not have a recall tax feature, although it works for these calculators too.

Procedure:

100 [ TAX+ ] [ - ] 100 [ = ]

Example:  (remember I'm using the tax rate set at 9.5% for all examples on this blog entry)

100 [ TAX+ ] [ - ] 100 [ = ]
Result:  9.5

2. Price After Sales Tax and the Amount of Tax

The [ TAX+ ] key performs two operations:

Press [ TAX+ ] once to calculate the total plus tax
Press [ TAX+ ] again to calculate the tax amount

Example:

An invoice shows of a purchase of equipment totaling $250.00.  Find the total after tax and the sales tax.

250 [ TAX+ ]
Display:  273.75   (total invoice:  $273.75)

[ TAX+ ]
Display:  23.75   (sales tax:  $23.75)


3. Adding Taxable and Non-taxable Amounts

Sometimes an invoice has both taxable amount and non-taxable amounts (such as most services, installation fee, sometimes freight, some food).  We can calculate the total invoice accurately with both the TAX and memory keys.  Start by clearing out the memory. 

Procedure:

[MRC] [MRC] taxable amount [ TAX+ ] [ M+ ] n
non-taxable amount [ M+ ] 
[MRC]  (recall memory)

Example:

Suppose has the invoice has:

A scanner that subject to sales tax:  $69.99
Computer services not subject to sales tax: $34.95
Sales Tax Rate:  9.5%

[ MRC ] [ MRC ] 69.99 [ TAX+ ] [ M+ ] 34.95 [ M+ ] [MRC]

The total invoice is $111.59   (8-Digit display shows 111.58905)


4. Calculating Use Tax

In certain states, such as California, use tax on a purchase can occur.  Where you take delivery determines what sales tax rate you would pay.  If a vendor does not charge the required tax, the use tax kicks in, which constitutes the remaining amount required from the buyer.  How to pay the use tax is beyond the scope of this blog entry. 

Procedure:

taxable amount [ TAX+ ] [ TAX+ ] [ - ] sales tax charged [ = ]

Example:

A purchase of a printer from an online store has a retail price of $164.79.  Sales tax of 8% was charged on the printer in the amount of $13.18.  The purchaser lives in a tax district that has a sales tax rate of 9.5%.  What is the use tax?

164.79 [ TAX+ ] [ TAX+ ] [ - ] 13.18 [ = ]  

The use tax is $2.48  (8-Digit display shows 2.47505)


5.  Find the Taxable Amount Given the Grand Total (Total Plus Tax) 

Sometime you know only the grand total of the invoice, but you need to find what was the taxable amount and the tax applied to that amount.  That is what the key [ TAX- ] is for.

Press [ TAX- ] once to calculate the taxable amount
Press [ TAX- ] again to calculate the tax amount

This is the inverse of the [ TAX+ ] key.

Example:

During an audit, we find an invoice from an electronics retail store for a purchase of a video projector.  However, only the total invoice is readable, in the amount of $187.44.  What is the retail price and what was the sales tax charged?

187.44 [ TAX- ]
Display:  171.17809   (taxable amount:  $171.18)

[ TAX- ]
Display:  16.261917 (sales tax:  $16.26)


6.  Finance: Using [ TAX+ ] to calculate Future Value

Time for a little unorthodox use of the TAX keys to calculate simple compound interest problems.  If you have an investment and you want to know how much your account will be in n periods (usually year), you can use the [ TAX+ ] [ = ] combination.

FV = PV * (1 + r%)^n

FV = future value
PV = present value
r% = interest rate, stored as the TAX rate
n = number of periods

Procedure:

[ MRC ] [ MRC ] 
present value [ M- ]
Loop:  [ TAX+ ] [ = ]   (do this n times for n periods)
(display future value)
[ M+ ] [ MRC ] 
(display interest earned)

Example:

You deposit $1,000.00 in a moderate to aggressive investment account that pays an average of 9.5% per year.  What is the balance after 5 years?  How much interest is earned in those five years?

[ MRC] [ MRC ] 
1000 [ M- ]
[ TAX+ ] [ = ]
[ TAX+ ] [ = ]
[ TAX+ ] [ = ]
[ TAX+ ] [ = ]
[ TAX+ ] [ = ]    (loop the last two keys 5 times)
Future value:  $1,574.24  (8-Digit display: 1574.2385)

[ M+ ] [ MRC ]
Interest earned:  $574.24  (8-Digit display:  574.2385)


7.  Finance: Using [ TAX- ] to calculate Present Value

Similarly, we can use the [ TAX- ] [ = ] combination to calculate the present value of a discounted note. 

PV = FV / (1 + r%)^n

FV = future value
PV = present value
r% = interest rate, stored as the TAX rate
n = number of periods

Procedure:

[ MRC ] [ MRC ] 
future value [ M+ ]
Loop:  [ TAX- ] [ = ]   (do this n times for n periods)
(display future value)
[ M- ] [ MRC ] 
(display interest earned)

Example:

You want to save $10,000.00 in five years.  You find an account that pays 9.5% annual interest.  How much will you need to deposit today to get that $10,000.00 goal in five years?

[ MRC] [ MRC ] 
10000 [ M+ ]
[ TAX- ] [ = ]
[ TAX- ] [ = ]
[ TAX- ] [ = ]
[ TAX- ] [ = ]
[ TAX- ] [ = ]    (loop the last two keys 5 times)
Present value:  $6,352.28  (8-Digit display: 6352.2775)

[ M- ] [ MRC ]
Interest earned:  $3,647.72  (8-Digit display:  3647.723)

What the [ TAX+ ] and [ TAX- ] Keys Calculate

With the tax rate r set:

[ TAX+ ] calculates:   number in the display * ( 1 + r/100)

[ TAX- ] calculates:  number in the display / (1 + r/100 )

Happy calculating and may all your calculations, and work weeks, be successful,

Eddie


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

HP Prime: Drawing 3D Lines and Boxes

HP Prime:  Drawing 3D Lines and Boxes

Introduction

I was sent an email from Carissa.  One of the questions was to explain the 3D features of LINE and TRIANGLE commands.  Confession:  I have never used to the 3D features of LINE and TRIANGLE before, time to learn something new.  Here is what I learned.


The Command LINE

In 3D drawing, you can connect as many points as you want.  In the most simple form, LINE takes three arguments:

*  Point Definition
*  Line Definition
*  Rotation Matrix

Point Definition

You define points of three dimensions (x, y, z) and if you want, a color.  The color attached to the point dominates any portion of the line that is nearest to the point.   The point definition is a nested list.

Syntax:  { {x, y, z, [color]}, {x, y, z, [color]}, {x, y, z, [color]}, ... }

Pay attention to the order you set your points.  Each point will be tied to an index.  For example, the first point in this list will have index 1, the second point in the list will have index 2, and so on.  Knowing the index number will be needed for the Line Definition.

Line Definition

This is where you assign which lines connect to which points.

Syntax:  { {index start, index end, [color], [alpha]}, {index start, index end, [color], [alpha]}, {index start, index end, [color], [alpha]},  ... }

Like the Point Definition, the Line Definition is a nested list.  You can make as many points as you want. 

Color and alpha in the List Definition overrides any color defined in the Point Definition list.

Rotation Matrix

This tells you the command how you want to rotate the matrix with the respect to the x, y, and z axis, respectively.  The acceptable size for the matrix is 2 x 2 (for x and y only), 3 x 3 (x, y, and z axis) and 3 x 4 (I'm not sure what the fourth column is for).  For this blog entry and in practice, I use the 3 x 3 rotation matrix.

In general:

Rx = [ [1, 0, 0],[0 cos a, -sin a],[0, sin a, cos a] ], rotation about the x axis at angle a
Ry = [ [cos b, 0, -sin b], [0, 1, 0], [sin b, 0, cos b ] ], rotation about the y axis at angle b
Rz = [ [cos c, -sin c, 0], [sin c, cos c, 0], [0, 0, 1] ], rotation about the z axis at angle c

Full Rotation matrix: r = Rx * Ry * Rz

You can create a program to calculate rotation matrix or copy the syntax to use in your drawing program, as shown here:

HP Program ROTMATRIX

EXPORT ROTMATRIX(a,b,c)
BEGIN
// rotate x axis
// rotate y axis
// rotate z axis
LOCAL x,y,z,r; 

x:=[[1,0,0],[0,COS(a),−SIN(a)],
[0,SIN(a),COS(a)]];
y:=[[COS(b),0,−SIN(b)],[0,1,0],
[SIN(b),0,COS(b)]];
z:=[[COS(c),−SIN(c),0],
[SIN(c),COS(c),0],[0,0,1]];
r:=x*y*z;

RETURN r;

END;

Drawing the Boxes

HP Prime Program:  DRAWBOX



The program DRAWBOX draws a simple box. 

EXPORT DRAWBOX()
BEGIN
// 3D line demo
// draw still box demo 
// 2019-04-23 EWS

// black background
RECT(0);

// colors - do this first
LOCAL c1:=#FFFF00h; // yellow
LOCAL c2:=#39FF14h; // neon green
LOCAL c3:=#FFFFFFh; // white


// points of the cube
LOCAL p:={{−3,0,0,c1},{0,−2,2,c1},
{3,0,0,c1},{0,2,−2,c2},
{−3,6,0,c1},{0,4,2,c1},
{3,6,0,c1},{0,8,−2,c2}};


// line definitions
// bottom
LOCAL d1:={{1,2},{2,3},
{3,4},{4,1}};
// top
LOCAL d2:={{5,6},{6,7},
{7,8},{8,5}};
// sides, override with white
LOCAL d3:={{1,5,c3},{2,6,c3},
{4,8,c3},{3,7,c3}};

// rotation matrix
LOCAL r:=[[1,0,0],[0,1,0],
[0,0,1]];

LINE(p,d1,r);
LINE(p,d2,r);
LINE(p,d3,r);

WAIT(0);

END;


HP Prime Program: DRAWBOX2



DRAWBOX2 takes three arguments, rotation of the x axis, rotation of the y axis, and rotation of the z axis.  The arguments are entered in degrees, as the calculator is set to Degrees mode in the program.

EXPORT DRAWBOX2(a,b,c)
BEGIN
// 3D line demo
// draw 3D box
// 2019-04-23 EWS
// rotate the cube

// set degrees mode
HAngle:=1;

// rotation calculation
// rotate x axis
// rotate y axis
// rotate z axis
LOCAL x,y,z,r; 

x:=[[1,0,0],[0,COS(a),−SIN(a)],
[0,SIN(a),COS(a)]];
y:=[[COS(b),0,−SIN(b)],[0,1,0],
[SIN(b),0,COS(b)]];
z:=[[COS(c),−SIN(c),0],
[SIN(c),COS(c),0],[0,0,1]];
r:=x*y*z;

// black background
RECT(0);

// colors - do this first
LOCAL c1:=#FFFF00h; // yellow
LOCAL c2:=#39FF14h; // neon green
LOCAL c3:=#FFFFFFh; // white


// points of the cube
LOCAL p:={{−3,0,0,c1},{0,−2,2,c1},
{3,0,0,c1},{0,2,−2,c2},
{−3,6,0,c1},{0,4,2,c1},
{3,6,0,c1},{0,8,−2,c2}};


// line definitions
// bottom
LOCAL d1:={{1,2},{2,3},
{3,4},{4,1}};
// top
LOCAL d2:={{5,6},{6,7},
{7,8},{8,5}};
// sides, override with white
LOCAL d3:={{1,5,c3},{2,6,c3},
{4,8,c3},{3,7,c3}};

// rotation matrix is already
// defined

LINE(p,d1,r);
LINE(p,d2,r);
LINE(p,d3,r);

WAIT(0);

END;

3D Triangles

The format for TRIANGLE is similar except the definition list has three points to make up the triangle instead of two. Format: {x, y, z, [ c ]}

Code:

EXPORT TEST6241()
BEGIN
// test 3D triangle
RECT_P();

//TRIANGLE({0,0,#0h,0},
//{2,2,#0000FFh,39},
//{1,5,#FF0000h,−2});

LOCAL c:=#400080h;
LOCAL p:={{0,0,0},{−10,−8,2},
{−6,4,3},{0,0,0}};
LOCAL d:={{1,2,3,c},{1,2,4,c},
{1,3,4,c},{2,3,4,c}};
local rotmat= [[1, .5, 0], [.5, 1, .5], [0, .5, 1]];   // Initial rotation matrix. No rotation but translate to middle of screen 
TRIANGLE(p,d,rotmat);

WAIT(0);
END;

Hope this helps and all of our drawing capabilities on the HP Prime are expanded.  Carissa, thank you for your email, much appreciated and I learned a great new skill.  All the best!

Eddie

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

TI-84 Plus CE: Time Plot of Two Parametric Equations

TI-84 Plus CE:  Time Plot of Two Parametric Equations

Introduction 

The program TIMEPLOT animates two parametric plots. 

TI-84 Plus Program TIMEPLOT
(237 bytes)

"EWS 2019-04-22"
Param
PlotsOff
FnOff
Input "T START:",A
Input "T STOP:", B
Input "T STEP:", S
int((B-A)/S) → N
A → T: {X1T} → L1 : {Y1T} → L2
{X2T} → L3: {Y2T} → L4
For(I,2,N)
A + S*(I-1) → T
augment(L1, {X1T}) → L1
augment(L2, {Y1T}) → L2
augment(L3, {X2T}) → L3
augment(L4, {Y2T}) → L4
Plot1(Scatter, L1, L2, □, BLUE)
Plot2(Scatter, L3, L4, □, GREEN)
DispGraph 
Wait 1
End



Example

X1T = 2 SIN T
Y1T = 3 SIN T

X2T = SIN (T^2/4)
Y2T = 1/2 * COS(T^2/8)

T START: 0
T STOP: 4 * π
T STEP: π / 24



Eddie

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

Wednesday, April 24, 2019

Casio fx-CG50: Animation of a Graph

Casio fx-CG50:  Animation of a Graph

Introduction

You can easily animate a graph with the Dynamic Graphing mode.   While I'm describing this procedure for the fx-CG50, I'm pretty sure it is available for the earlier models such as fx-CG10, fx-9750GII, and fx-9860GII.

Specifically, you can dynamically change a single variable between two points with a specified step.

For example:  y = A*x  where A varies from 0 to 5, and its step is 1.

General Procedure

1.  Enter Dynamic Graph mode.  On the fx-CG50, press [ MENU ], [ 6 ].

2.  Type and select an equation.  The equation can be a function, a set of parametric equations, a polar equation, or on newer calculators, a shaded inequality.

3.  Press [ F4 ] (VAR) to take you to the variable screen.   Select the variable you want to animate.  You can animate any variable A - Z and θ.  Keep in mind that X is used for functions equations, T is used for parametric equations, and θ is for polar equations.

4.  Set the Animation Speed by pressing [ F3 ] (SPEED).  The speeds that can be selected are:

F1:  Stop & Go  (you advance the slides with the right and left arrows)
F2:  Slow speed
F3:  Normal speed
F4:  Fast speed

5.  Press [ F6 ] (DYNA) to start the animation.  To stop it, press [ AC ].

Example 

x1(t) = 1.2 * A * cos T
y1(t) = A * sin (T + 1) * cos (π/(3*T))
with π/12 ≤ T ≤ 2 π, step π/12





Eddie

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

App Review: SciPro Math - Campusano (Revisited)

App Review:  SciPro Math - Campusano (Revisited)

The Return of SciPro Math

If you want to see my review of my previous version, please check here:  http://edspi31415.blogspot.com/2018/01/app-review-scipro-math-campusano-apple.html

This review is for the current version (Version 4).  I was emailed by the programmer Roberto A. Campusano when the latest version is now available. 

Quick Facts:

Title:  SciPro Math
Author/Programmer:  Robert A. Campusano
Platform:  iOS
Price: $9.99
Version:  4.0
Website:  https://scipromath.com/







Introduction

The SciPro Math calculator app is a scientific calculator that features over 648 functions that features many applications, including:

*  U.S.-SI Conversions
*  Finance
* Geometry
* Fractions and Proportions
* Solving Linear Systems up to 4 x 4
* Solving Polynomials up the order 4

The SciPro Math has two modes.  If your Apple device (iPhone, iPad, or iPod Touch) is in the portrait position, it is a simple, four function calculator.  If your Apple device  is in the landscape position, it is in the scientific calculator.

The calculator runs in Chain mode.  Therefore, there is no algebraic preferences or parenthesis.  It could get a little used to if you are accustomed to traditional scientific calculators, but not a big deal once get a hang of it.  If you are used to regular four-function calculators, you should feel right at home with the operation of the SciPro Math.

The rest of this review and blog will assume that you are working in scientific calculator mode (landscape). 

The Modifier Toggle Keys

The calculator has five modifier keys:  [ 2nd ], [ 3rd ], [ rad (off), deg (on) ] (4th), [ 5th ], and [ 6th ].  The modifier keys act as toggles, and depending on whether they are turned on and off, determine what keyboard is present.  You can quickly access any keyboard by entering the keyboard's number and pressing the purple [SC] key on top of the app.

I'm going to give details on some of the keyboards later, but information for all the 24 keyboards can be found here:  https://scipromath.com/the-screens/

Think of the modifier keys as "binary powers of 2:"

[2nd] is the 1 flag
[3nd] is the 2 flag
[rad/deg (4th)] is the 4 flag
[5th] is the 8 flag
[6th] is the 16 flag

Any total of flags that exceed 24 shows the 24th keyboard:  Storage Space keyboard.  Here you can access 26 memory registers Av through Zv.

Storing and Calculating

A lot of the keyboards is a dedicated solver for a specific application.  I will go over some of the details later but in general, the keys that belong to a calculation are all grouped by colors. 

In general, in a color group if the key has the format [ var.app ], that is an input variable.  Input the value by typing it, pressing the indigo [ →(X)v ] store button. 

If a key has an equal sign at the end, [ var.app= ], that is an output variable.  Press this button to get the answer. 

Documentation

One of the things that I wasn't crazy about in my previous review was the lack of documentation.  Thankfully, this has greatly improved.

First, the app will give prompts of what each key does.  The prompt will appear in indigo on the upper right hand screen.  I find this super helpful when learning how to use the app. 

Second, the app has its own YouTube channel, SciPro math.  The videos, by Roberto Campusano  explain on how to use some of the applications in a clear, concise fashion.  If you are using this app for the first time, I recommend going over the videos. 

SciPro Math's YouTube channel:  https://www.youtube.com/channel/UCKHZdGBoHBUazE--0CDn4aQ/videos

Some Keyboard Details

Keyboard 0:  Basic Operations - Angles are in Degrees
Modifiers:  None

Variable Registers:  Av, Bv, Cv
Trig Functions:  sin, cos, tan, sci, csi, bta, sihn, cosh, tanh
Functions:  log, ln, 10^x, e^x, x^2, x^3, √, x^1/3, x^-1
Constants:  π, e, Φ

The functions of sci, csi, and bta are specialized. 

Keyboard 1:  Basic Operations - Angles are in Degrees 
Modifiers:  [ 2nd ]

Variable Registers: Dv, Ev, Fv
Trig functions: sec, sec, cot, bsc, bcs, bct, csch, sech, coth
Functions: ln(x+1), x! (x must be an integer), power, roots, log base 2, e^(x-1)
Constants:  γ

Note:  bsc x = 1/sci x,  bct x = 1/csi x, bct x = 1/bta x

Keyboard 2:  Pythagorean Theorem (and Inverse Trig Functions) - Angles are in Degrees

Variable Registers: Gv, Hv, Iv
Inverse Trig Functions: sin^-1, cos^-1,  tan^-1, sinh^-1, cosh^-1, tanh^-1
Constants:  π/2, π/3, π/4, √2, ln 2
Angle Conversions:  r-deg (radians to degrees), d-rad (degrees to radians)

Hypotenuse Function:
x  [hyp] y [ = ] returns √(x^2 + y^2)

Side Function:
x [side] y [ = ] returns √|x^2 - y^x|    ( | n | = abs(n))

Keyboard 3:  Probability
Modifiers: [ 2nd ], [ 3rd ]

Variable Registers: Jv, Kv, Lv
Random Integers:  rand52 (1 -52), rand10 (1 - 10), coin (0 - 1), dice (1 - 6)
x [ x-y ] y [ = ] returns a random integer between x and y.  x and y can be negative

Probability:
x [ xCr ] r [ = ] returns x! / ( (x - r)! * r!): the number of the combinations
x [ xPr ] r [ = ] returns x! / (x - r)!:  the number of permutations

Conversions: between temperatures °F, °C, K

Keyboard 4:  Conversions, Trig in Radians
Modifiers:  [rad/deg] turned to deg

Trig Functions: sci, cos, tan, sci,csi, bta
Conversions: in/mm, in/cm ft/cm, ft/m, yd/m, mi/km, lb/kg

Keyboard 6:  Conversions, Trig in Radians
Modifiers:  [ 3rd ], [ rad/deg ] turned to deg

Trig Functions: sin^-1, cos^-1, tan^-1
Conversions: tsp/Tsp, Tsp/cu, tsp/mL, cu/pt, pt/qt, qt/gal, gal/L

Keyboard 8:  Fractions and Ratios, Slope
Modifiers: [ 5th ]

Two fractions in the form of a/b and c/d
[ a ]:  numerator input of a/b
[ b ]:  denominator input of a/b
[ c ]:  numerator input of c/d
[ d ]: denominator input of c/d

Addition of fractions: Numerator:  [ ad + bc ], Denominator: [ bd ]
Subtraction of fractions: Numerator: [ ad - bc ], Denominator: [ bd ]
Multiplication of fractions: Numerator: [ ac ], Denominator: [ bd ]
Division of fractions: Numerator: [ ad ], Denominator: [ bc ]

Slope of two points (x1, y1) and (x2, y2): 
Input:  [x1 ], [ y1 ], [ x2 ], [ y2 ]
Output:  [ slope ]:  (y2 - y1)/(x2 - x1);  [ -m^-1 ]:   -(x1 - x2)/(y1 - y2)

Keyboard 9:  Linear Equations
Modifiers: [ 2nd ], [ 5th ]

Linear Form:  ax + by = c
s(x) and t(x) contains this form. 
Input:  [ ax1 ], [ by1 ], [ cx0 ]
Output: [ x-int ]: x-intercept of s(x); [ y-int ]: y-intercept of s(x);
[ s(x)= ]: solve for y given x; [ s^-1(x) ]: solve for x given y

Slope Intercept Form: mx + b
f(x) and g(x) contains this form
Input: [ mx1 ], [ bx0 ]
Output: [ f(x)= ]:  solve for y given x; [ f^-1(x) ]: solve for x given y

Keyboard 10: Quadratic Equations
Modifiers: [ 3rd ], [ 5th ]

Equation:  j(x) = a0 *x^2 + a1 * x + a2
Input:  [ a0x^2 ], [ a1x^1 ], [ a2x^0 ]

Output:
Roots:  Real: [ x21  ], [ x22 ];  Imaginary:  [ x21i ], [ x22i ]
[ D2 ]: discriminant

Keyboard 11:  Cubic Equation - Modifiers [ 2nd ], [ 3rd ], [ 5th ]

Keyboard 12:  Quartic Equation - Modifiers [ rad/deg ] set to deg, [ 5th ]

Keyboard 16:  3 x 3 Linear System - Modifiers [ 6th ]

Keyboard 20: Geometry 
Modifiers:  [ rad/deg ] set to deg, [ 6th ]

Sphere:  Input:  r.sp (radius).  Output: D.sp (diameter), V.sp (volume), S.sp (surface area)
Circle: Input: r.c (radius).  Output: D.c (diameter), A.c (area), C.c (circumference)
Trapezoid: Input: b1 (base 1), b2 (base 2), h/t (height).  Output: A/t (area)
Rectangle:  Input: l.r (length), w.r (width).  Output: A.r (area), P.r (perimeter)
Triangle: Input: a.t (side a), b.t (side b), c.t (side c). Output:  A.t (area), P.t (perimeter)
Box:  Input: l.b (length), w.b (width), h.b (height).  Output: V.b (volume), S.b (surface area)

Verdict

I'm really happy with this updated version of SciPro Math, the online prompts make a huge difference, and the how-to videos are top notch.  Also, the operation of the calculator is simple and is good for quick calculations. 

This app is worth looking into and now I see the justification of spending the $9.99 on this app. 

Eddie

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

TI-74: Five Stencil Derivative, Vertical Height on a Hill, Solving Cubic Equations

TI-74:  Five Stencil Derivative, Vertical Height on a Hill, Solving Cubic Equations

TI-74 Program: Five Stencil Derivative

This program estimates the numerical derivative of f(x) at x0 by the formula:

f'(x0) ≈ ( -f(x0+2h) + 8*f(x0+h) - 8*f(x0-h) + f(x0-2h) )/(12h)

Source:  "Five Stencil Method"  Wikipedia.  Page last edited November 8, 2018.  https://en.wikipedia.org/wiki/Five-point_stencil  Retrieved April 14, 2019

Note:  comments (after !) are for notes, and do not need to be typed. 


500 PRINT "F(X) IS ON LINE 550.": PAUSE 1: RAD  ! RAD sets radians mode
502 INPU T "X: ";A
504 INPUT "H: ";H
506 D=0: X=A+2*H: GOSUB 550
508 D=-F: X =A+H: GOSUB 550
510 D=8*F+D: X=A-H: GOSUB 550
512 D=D-8*F: X=A-2*H: GOSUB 550
514 D=(D+F)/(12*H)
516 PRINT "DF/DX =";D: PAUSE 
518 END
550 F=5.2^X  ! Insert F(X) here
552 END

Examples:

550  F=5.2^X
x0 = 1.2, h = 0.001, Result:  11.92160564

550 F=EXP(X)*SIN(X)
x0 = PI/3, h = PI/24, Result: 3.892851849

TI-74 Program:  Vertical Height on a Hill

Variables:
H = height of the observer
L = horizontal length
V = vertical angle (entered in degrees-minutes-seconds, DD.MMSSSS)
G = ground slope (entered in degrees-minutes-seconds, DD.MMSSSS)

If G>0, the hill is at an elevation.  If G<), the hill is at an depression.

T = total height = vertical difference + observer's height
T = L * (tan V - tan G) + H

Since there is no DMS to decimal conversion function in TI-74's basic, a conversion is necessary. The following is sample code where A is DMS format needed to be converted:

T = ABS(A)
D = INT(T)
M = INT((T-D)*100)
S = ((T-D)*100-M)*100
A = (D+M/60+S/3600)*SGN(A)

The program code is shown below:

600 INPUT "LENGTH: ";L
602 INPUT "OBSERVER'S HEIGHT: ";H   ! ' is SHIFT + SPACE

604 DEG: PRINT "ANGELS IN DD.MMSSSS": PAUSE 1.5
606 INPUT "VERTICAL ANGLE: ";V: A=ABS(V)
608 D=INT(A): M=INT((A-D)*100): S=((A-D)*100-M)*100
612  V=(D+M/60+S/3600)*SGN(V)

614 INPUT "GROUND SLOPE: ";G: A=ABS(G)
616 D=INT(A): M=INT((A-D)*100): S=((A-D)*100-M)*100
618 G=(D+M/60+S/3600)*SGN(G)

620 T=L*(TAN(V)-TAN(G))+H
622 PRINT "TOTAL HEIGHT =";T: PAUSE
624 END

Examples:

Input:  L: 10 m, V: 30°14'33", G: 10°30'00", H = 1.7780 m
Result:  T = 5.754638129 m

Input:  L: 10 m, V: 30°14'33", G: -10°30'00", H = 1.7780 m
Result:  T = 9.461464028 m

Source: 

F.A. Shepherd "Engineering Surveying: Problems and Solutions" 2nd Edition  Edward Arnold Publishers Ltd.  London, UK  1983 ISBN 0-7131-3478-X

TI-74 Program:  Solving Cubic Equations

This program solves the cubic equation:

A*X^3 + B*X^2 + C*X + D = 0

This program uses Newton's method to get the first root, then divides the polynomial by (x - root).  Finally the quadratic formula is used to find the other two roots.  This program assumes the coefficients A, B, C, and D are real.  An initial guess of 1 is used (can be changed, see line 710).

700 PRINT "A*X^3+B*X^2+C*X+D=0, REAL COEFS.": PAUSE 1.5
702 INPUT "A: ";A
704 INPUT "B: ";B
706 INPUT "C: ";C
708 INPUT "D: ";D

710 X=1
712 XN=X-(A*X^3+B*X^2+C*X+D)/(3*A*X^2+2*B*X+C)
714 IF ABS(XN-N)<1e-9 718="" font="" then="">
716 X=XN: GOTO 712

718 X1=XN
720 PRINT "X1 =";X1: PAUSE
722 J=-(A*X1+B)
724 K=(A*X1+B)^2-4*A*(A*X1^2+B*X1+C)
726 IF K<0 750="" font="" then="">
728 X2=(J+SQR(K))/(2*A): X3=(J-SQR(K))/(2*A)
730 PRINT "X2 =";X2: PAUSE
732 PRINT "X3 =";X3: PAUSE
734 END

750 XR=J/(2*A): XI=SQR(ABS(K))/(2*A)
752 PRINT XR;"+- ";XI;"I": PAUSE
754 END

Example:
A: 1, B: 1, C: -9, D: -9
Roots: -3, 3, 1
Eddie

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

Casio fx-CG50 and HP Prime: Azimuth/Bearing Conversions

Casio fx-CG50 and HP Prime: Azimuth/Bearing Conversions Introduction The programs A2B (Azimuth to Bearing) and B2A (Bearing to Azi...