Showing posts with label area of a regular polygon. Show all posts
Showing posts with label area of a regular polygon. Show all posts

Sunday, May 3, 2020

Construction Master 5: Area of Regular Polygons

Construction Master 5: Area of Regular Polygons



Introduction:  Area of a Regular Polygon



The area of a regular polygon is:

Area = 1/2 * P * A

where:
P = perimeter = n * S 
n = number of sides
S = side length
A = apothem length

Divided the regular polygon from drawing lines from the center to each of the polygon's vertices.  Triangles about the center are formed with a central angle, 360° ÷ n. 

The apothem bisects each of the triangles, with the angle nearest to the center of 180° ÷ n.   A right angle is formed between the side and apothem.   The small triangle formed has the base of the s ÷ 2 (since the apothem bisects the side) and A.  The triangle has angles half-central angle (HCA), 90°, and 180° - 90° - HCA.  I will refer to the third angle as the Pitch angle (see the diagram above). 

The trigonometric relationships are:

tan( Pitch ) = A / ( s / 2 )

A = s / 2 * tan(Pitch)

s = 2 * A / tan(Pitch)

It is possible to determine the area of regular polygon knowing the number of sides and either the side length or the apothem.

The Calculated Industries Construction Master 5 does not have trigonometric keys.  However, the Construction Master 5 has four keys that deal with right triangles:

[ Pitch ]:  angle in degrees.  Enter the angle as a unit-less measure.  For example, to enter 60°, press 60 [ Pitch ].  The angle considers the rise of the opposite side, and run the adjacent side.

[ Rise ]:  rise - opposite side.  The Rise is considered the apothem of length A.  You can enter either unit-less or measured amounts (feet/inches/yards/m). 

[ Run ]:  run - adjacent side.  You can enter either unit-less or measured amounts (feet/inches/yards/m).  This represents the side or half-side.

[ Diag ]:  hypotenuse.  The algorithms will not use this key in this blog. 

Known:  Number of Sides and Side Length

The Math:

Area

= 1/2 * P * A
= 1/2 * n * s * (s/2 * tan(Pitch))
= 1/4 * n *  (s * tan(Pitch))

Keystrokes:

180 [ ÷ ] n [ Conv ] (+/-) [ + ] 90 [ Pitch ]
s [ Run ]
[ Rise ] [ × ] [ Rcl ] [ Run ] [ × ] n [ ÷ ] 4 [ = ]

Example:
s = 40 ft, n = 6

180 [ ÷ ] 6 [ Conv ] (+/-) [ + ] 90 [ Pitch ]    (Display:  PTCH 60.00°)
40 [ Feet ] [ Run ]
[ Rise ] [ × ] [ Rcl ] [ Run ] [ × ] 6 [ ÷ ] 4 [ = ]   (Display:  4156.922 SQ FEET)

Area ≈ 4156.922 ft^2

Known:  Number of Sides and Apothem

The Math

Area

= 1/2 * P * A
= 1/2 * (n * s) * A
= 1/2 * n * (2 * A) / tan(Pitch) * A
= n * A  * (A / tan(Pitch))

Keystrokes:

180 [ ÷ ] n [ Conv ] (+/-) [ + ] 90 [ Pitch ]
s [ Rise ]
[ Run ] [ × ] [ Rcl ] [ Rise ] [ × ] n [ = ]

Example:
A = 40 ft, n = 6

180 [ ÷ ] 6 [ Conv ] (+/-) [ + ] 90 [ Pitch ]   (Display:  PTCH 60.00°)
40 [ Feet ] [ Rise ]
[ Run ] [ × ] [ Rcl ] [ Rise ] [ × ] 6 [ = ]   (Display:  5542.563 SQ FEET)

Area ≈ 5542.563 ft^2

And that is how to find the area of a regular polygon using the Construction Master 5.

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.

Thursday, June 23, 2016

Programming with the Radio Shack EC-4004

Programming with the Radio Shack EC-4004

(Another milestone: this is blog #600! I can't thank you all enough!) 

To see my retro review of this calculator I did two years ago, click here:




The Radio Shack EC-4004 calculator’s programming mode is AOS (algebraic operating system).  Rarely you see a calculator with AOS any more (think the Casio fx-260 and Texas Instruments TI-30A), but it used to be prominent operating system with RPN.   In AOS, the uniary functions (trigonometric, logarithmic, factorial, for example) are entered after you enter the number.  Hence:  14 [ln] calculates ln(14) ≈ 2.639057329.

The storage of the EC-4004 is a mere 38 steps which can be distributed into two program slots.  That is not a lot.  Furthermore, if you enter numeric constants, each digit counts a step.  Remember, the display does NOT display the key, so be careful when entering programs.  There are a few program commands:

RTN ([INV] [ 9 ]):  Returns program control the first step (beginning). 

X ≤ M ([INV] [ 8 ]):  If the display is less than or equal to M, return to the first step.  Otherwise, go to the next step.

X > 0 ([INV] [ 7 ]): If the display is greater than 0, return to the first step.  Otherwise, go to the next step.

ENT ([RUN] in learn mode):  Prompt for a number.  The next step is to put a “placeholder” number as long as it will be valid in calculations.  Since each digit counts as a step, try to use placeholder numbers like 0, 1, or 2.  I’m not sure if the placeholder number is merged with ENT.  You can instead, use Kin or Min to store the entry in memory.

HLT ([INV] [RUN]): Halts the program to display immediate results.  Think of it as the PAUSE command.

X<>K ([INV] [Kout]): Exchange with a memory register.  The EC-4004 has six memory registers, plus one additional independent memory register (M).

[Kin] and [Kout] is your store and recall, respectively.

On to the list of sample programs!  Anything after double slashes (\\) is a comment. The hashtag (#) stands for placeholder number.

Area of a Regular Polygon

Formula:  (n*s^2)/(4*tan(180°/n)), n = number of sides, s = side length

MODE,  4 \\ sets Degree mode
ENT \\ prompt for n
#  \\ enter a placeholder number
Min \\ store in M
*
ENT \\ prompt for s
#  \\ placeholder number
X^2
÷
(
4
*
(
180
÷
MR \\ recall n
)
TAN
)
=

Test 1:  n = 6, s = 2.6,  result 17.56299519
Test 2:  n = 10, s = 3.87, result 115.2353964

 Sum of f(x)

In particular, Σ x^2 + 1 from x = 1 to M.  M is the upper limit.  You can adapt this to include any f(x), but remember you’ll only have 26 steps to work with for f(x).  Your variable for f(x) is register 1 (use [Kout], 1)

Before running, store the upper limit minus 1 in M, 0 in both registers 1 and 2.  (0, [ Kin ], 1; [ Kin ], 2).  Register 1 is your counter, register 2 is your sum.   In Summary:

M = upper limit – 1, Register 1 = 0, Register 2 = 0

Kout 1  \\ recall register 1 and add one
+
1
=
Kin 1
X^2 \\ f(x) starts here
+
1
=   \\ end f(x) with equals
+   \\ add result to register 2
Kout 2
=
Kin 2
Kout 1 \\ put register 1 in the display
X≤M   \\ is X≤M? If so, go to the beginning
Kout 2 \\ display sum

Test 1:  If the upper limit is 5, store 4 in M.  Result:  60
Test 2:  If the upper limit is 8, store 7 in M.  Result:  212

Payment of a Loan (with no balloon)

Formula:  PMT = PV / ((1 – (1 + r)^-n)/r)

Store the following amounts before running:
K1 = PV, present value or loan amount
K2 = n, number of payments.  Example: For 30 years for monthly payments, store 360 in K2.
K3 = r, periodic interest rate as a decimal.  Example: For 6% compounded monthly, enter 0.06/12 in K3.


Kout 1 \\ recall PV
÷
(
(   
1
-
(
1
+
Kout 3  \\ recall r
)
X^Y
Kout 2 \\ recall n
+/-
)
÷
Kout 3
)
=


Test 1:  K1 = 200,000, K2 = 360, K3 = 0.055/12.  Result:  1,135.58
Test 2:  K1 = 234,000, K2 = 360, K3 = 0.038/12.  Result:  1,090.34

Easy Traverse Calculation

Calculates the new point knowing the original coordinates, direction, and angle of travel.  The angle 0° comes from due east and rotates counterclockwise (see diagram below). 



Store before hand:
K1 = original coordinate easting (E, x)
K2 = original coordinate northing (N, y)

Distance is stored in K3 and angle is stored K4.  At the completion of the program, the new coordinates are stored in K1 and K2, respectively, to allow chain calculations.

MODE 4 \\ degrees mode
Kout 1
+
ENT \\ prompt for distance
# \\ placeholder number
Kin 3
*
ENT \\ prompt for angle
# \\ placeholder number
Kin 4
COS
=
Kin 1
HLT \\ display new easting coordinate
Kout 2
+
Kout 3
*
Kout 4
SIN
=
Kin 2 \\ display new northing coordinate


Test:  E0 = 10,000,  N0 = 10,000
Given distance = 110, angle = 126°,  E1 ≈ 9,935.343, N1 ≈ 10,088.992
Continuing,
Given distance = 150, angle = 30°, E2 ≈ 10,065.247, N2 ≈ 10,163.992

Measuring Dew Point (in degrees Celsuis)

W = 237.3 * V/(1 – V)
V = (ln H + (17.27*C)/(237.3+C))/17.27

Where:
H = relative humidity, store as a decimal (Example:  for 55.8% store 0.558 in K1)
C = temperature in degrees Celsius

Store before hand:  H in register 1 (K1), C in register 2 (K2). 

This program illustrates a perfect example of the effect of the limited programming space.  During the calculation, 17.27 and 237.3 are stored in K3 and K4, respectively to save program space.  And believe me, we’ll need every bit of it.

Kout 1 \\ H
LN
+
17.27
Kin 3
*
Kout 2 \\ C
÷
(
237.3
Kin 4
+
Kout 2
)
=
÷
Kout 3
Min // store V in M
*
Kout 4
÷
(
1
-
MR
)
=

Remember K1 = H, K2 = C
Test 1:  H = 51% (0.51), C = 27°C, Result ≈ 16.0003°C
Test 2:  H = 46% (0.46), C = 85°F = 29.44444444°C, Result ≈ 16.6110°C

Chebyshev Polynomial of the First Kind, for -1<x<1

Formula for -1<x<1:  T_n(x) = cos(n * acos x)   (source: Wolfram, http://mathworld.wolfram.com/ChebyshevPolynomialoftheFirstKind.html, see line 44)

ENT \\ prompt for x
#  \\ placeholder number
COSˉ¹
*
ENT \\ prompt for n
#  \\ placeholder number
=
COS

Test 1:  T_2(0.25) = -0.875  (x = 0.25, n = 2)
Test 2:  T_3(-0.68) = 0.782272  (x = -0.68, n = 3)

That is a small collection of programs for the EC-4004.  If you want me to do more, let me know.  Until then, have a great day everyone and stay safe!

Eddie

This blog is property of Edward Shore, 2016



DM42 and HP 42S: Quadratic Equation, Characteristic Polynomial, and Eigenvalues

DM42 and HP 42S: Quadratic Equation, Characteristic Polynomial, and Eigenvalues The programs are listed for the Swiss Micros DM42 an...