Showing posts with label regular polygons. Show all posts
Showing posts with label regular polygons. Show all posts

Saturday, April 20, 2024

Sharp EL-9300 Programs

Sharp EL-9300 Programs


Today’s blog entry takes us to the 1992 Sharp’s EL-9300 graphing calculator. On January 10, 2022, I gave a review of this calculator:

https://edspi31415.blogspot.com/2022/01/retro-review-sharp-el-9300c.html



The programs should also work on the EL-9200. Spaces are added for readability.



Sharp EL-9300 Program: polygon2


The program polygon2 calculates four properties of regular polygons:

* The internal angle of the polygon

* The length of the polygon’s apothem

* The length of the polygon’s radius

* The area of the polygon


A regular polygon is a polygon whose sides all have equal length and all the internal angles are equal.


REAL Mode

Print “Set Degrees 1st”

Wait 1

Print “number of sides”

Input n

Print “side length”

Input x

angle = (n – 2) / n * 180

apothem = x / 2 * tan (angle / 2)

radius = x / (2 * cos (angle / 2) )

area = n * x * apothem / 2

ClrT

Print angle

Print apothem

Print radius

Print area



Note that the calculator must be set in Degrees mode prior to running this program. To set the degrees mode, press [ SET UP ], [ B ], [ 1 ]. Note that this won’t set the angle mode indicator in the program as the angle mode change takes place outside of the program script.


Examples


Inputs: n = 6, x = 8

Outputs:

angle = 120 (internal angle)

apothem = 6.92820323

radius = 8

area = 166.2768775



Inputs: n = 12, x = 1.5

Outputs:

area = 150

apothem = 2.799038106

radius = 2.897777479

area = 25.19134295



Sharp EL-9300 Program: agm


The program agm calculates the arithmetic-geometric mean between two numbers x and y.


(x + y) / 2

√(x * y)


The program also asks for the tolerance. If the tolerance is small, it means we are asking for better accuracy at the expense of additional calculations.


REAL Mode

ClrT

Print “arithmetic/”

Print “geometric mean”

Input x

Input y

Print “tol (10^-nn)”

Input tol

Label loop

a = (x + y) / 2

g = √(x * y)

x = a

y = g

If abs(a – g) >= tol Goto loop

ClrT

Print “results”

Print a

Print g

End


Examples


Inputs: x = 15, y = 70, tol = 10^-6

Outputs:

a = 37.28076573

g = 37.28076573


Inputs: x = 1649, y = 1248, tol = 1E-7

Outputs:

a = 1441.519759

g = 1441.519759


The EL-9300 is pretty quick.



Sharp EL-9300: quadratic


The program quadratic solves the quadratic equation:


a * x^2 + b * x + c = 0


where a, b, and c can be real or complex numbers.


COMPLEX Mode

ClrT

Print “ax^2+bx+c=0”

Print “complex numbers”

Input a

Input b

Input c

x = (-b + √(b^2 – 4 * a * c)) / (2 * a)

z = x - √(b^2 – 4 * a * c) / a

ClrT

Print “solutions=”

Print x

Print z

End


Examples


Inputs:

a = 4 + 3i, b = 2 – 5i, c = 3i

Solutions:

x = 0.346818295 – 0.288439118i

z = -0.066818295 + 1.328439118i


Inputs:

a = 2, b = -6i, c = -4 + 8i

Solutions:

x = 1.370730624 + 0.040924113i

z = -1.370730624 + 2.959075887i



Sharp EL-9300 Program: twobytwo


The program twobytwo solves the simultaneous set of equations:


a * x + b * y = e

c * x + d * y = f


where a, b, c, d, e, and f can be complex numbers.


COMPLEX Mode

Print “2x2 system”

Print “complex numbers”

Print “A=((a,b)(c,d))”

Input a

Input b

Input c

Input d

Print “B=((e)(f))”

Input e

Input f

g = a * d – b * c

h = e * d – f * b

i = a * f – c * e

x = h / g

y = i / g

ClrT

Print “solutions=”

Print x

Print y

End



Examples


Input:

a = 3 + 2i, b = -i

c = 3 – 2i, d = 1 – i

e = 0, f = 5i

Outputs:

x = -0.660377358 + 0.188679245i

y = -0.754716981 + 2.358490566i


Input:

a = 3, b = -6

c = 3i, d = 6i

e = 1, f = -i

Outputs:

x = 0

y = -0.166666667




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.


Saturday, February 1, 2020

TI-59: Geometric Areas

TI-59: Geometric Areas



Introduction

The program calculates areas of planar geometric shapes.  The following user keys are defined:

A:  Enter A or radius.

B:  Enter B

C:  Enter C

D:  Display the total area

E:  Clear the total area

A':  Calculate the area of an Ellipse:  π*A*B.  For a circle, A = B

B':  Calculate the area of a Rectangle:  A*B.  For a square, A = B

C':  Calculate the area of a Triangle using Heron's Formula. 
S = (A + B + C)/2; √(S * (S - A) * (S - B) * (S - C))

D':  Calculate the area of Sector of a Circle:  π*B°*A^2/360
A:  radius, B: angle in degrees

E':  Calculate the area of a Regular Polygon:  (B * A^2)/(4 * tan(180°/B))
A:  length of a side, B:  number of sides (degrees)

Each calculation will add to the total area.

Memory Registers:

R01:  A
R02:  B
R03:  C
R04:  total area
R05:  S = (A + B + C)/2

The program is for the TI-58C, TI-58, TI-59, their emulators, and TI-66.

TI-59 Program:  Geometry Areas

000 76 LBL
001 11 A
002 42 STO
003 01 01
004 91 R/S
005 76 LBL
006 12 B
007 42 STO
008 02 02
009 91 R/S
010 76 LBL
011 13 C
012 42 STO
013 03 03
014 91 R/S
015 76 LBL
016 14 D
017 43 RCL
018 04 04
019 91 R/S
020 76 LBL
021 15 E
022 25 CLR
023 42 STO
024 04 04
025 91 R/S
026 76 LBL
027 16 A'
028 89 PI
029 65 *
030 43 RCL
031 01 01
032 65 *
033 43 RCL
034 02 02
035 95 =
036 44 SUM
037 04 04
038 91 R/S
039 76 LBL
040 17 B'
041 43 RCL
042 01 01
043 65 *
044 43 RCL
045 02 02
046 95 =
047 44 SUM
048 04 04
049 91 R/S
050 76 LBL
051 18 C'
052 53 (
053 43 RCL
054 01 01
055 85 +
056 43 RCL
057 02 02
058 85 +
059 43 RCL
060 03 03
061 54 )
062 55 /
063 02 2
064 95 =
065 42 STO
066 05 05
067 65 *
068 53 (
069 43 RCL
070 05 05
071 75 -
072 43 RCL
073 01 01
074 54 )
075 65 *
076 53 (
077 43 RCL
078 05 05
079 75 -
080 43 RCL
081 02 02
082 54 )
083 65 *
084 53 (
085 43 RCL
086 05 05
087 75 -
088 43 RCL
089 03 03
090 54 )
091 95 =
092 34 SQRT
093 44 SUM
094 04 04
095 91 R/S
096 76 LBL
097 19 D'
098 60 DEG
099 89 PI
100 65 *
101 43 RCL
102 02 02
103 65 *
104 43 RCL
105 01 01
106 33 X²
107 55 /
108 03 3
109 06 6
110 00 0
111 95 =
112 44 SUM
113 04 04
114 91 R/S
115 76 LBL
116 10 E'
117 53 (
118 01 1
119 08 8
120 00 0
121 55 /
122 43 RCL
123 02 02
124 54 )
125 60 DEG
126 30 TAN
127 65 *
128 04 4
129 95 =
130 35 1/X
131 65 *
132 43 RCL
133 02 02
134 65 *
135 43 RCL
136 01 01
137 33 X²
138 95 =
139 44 SUM
140 04 04
141 91 R/S

Example

5 [ A ]  6 [  B ]

[2nd] [ A' ]   Result:  94.24777961  (area of an ellipse with A = 5, B = 6)

[2nd] [ B' ]  Result:  30  (area of a rectangle with A = 5, B = 6)

9 [ C ]

[2nd] [ C' ]  Result: 14.14213562  (area of a triangle with A = 5, B = 6, C = 9)

9 [ A ] 60 [ B ]

[2nd] [ D' ]  Result: 42.41150082 (area of a circular sector A = 9, B = 60°)

9 [ A ] 8 [ B ]

[2nd] [ E' ]  Result:  391.1025971 (area of a polygon with a side length of 9 and 8 sides)

[ D ]  Total Area:  571.9040132

[ E ] clears total area

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.

Wednesday, March 22, 2017

HP 15C: Regular Polygon: Internal Angle, Area, Perimeter



Hope you all like the new background and style changes!  Thank you for the success of this blog - less than a month to the blog's sixth birthday (4/11/2017).  


HP 15C:  Regular Polygon: Internal Angle, Area, Perimeter

Inputs (Store values before running the program):
R0:  n, number of sides
R1:  s, length of each side

Outputs:
R2:  θ, Internal Angle
R3:  A, Area
R4:  P, Perimeter

Formulas Used (Degrees Mode Used):

Internal Angle:  θ = 180° - 360°/n
Area:  A = (s^2 * n)/(4 * tan (180°/n))
Perimeter:  P = s * n

Step
Key
Code
001
LBL C
42, 21, 13
002
DEG
43, 7
003
1
1
004
8
8
005
0
0
006
ENTER
36
007
ENTER
36
008
2
2
009
*
20
010
RCL÷ 0
45, 10, 0
011
-
30
012
STO 2
44, 2
013
R/S
31
014
RCL 1
45, 1
015
X^2
43, 11
016
RCL* 0
45, 20, 0
017
1
1
018
8
8
019
0
0
020
RCL÷ 0
45, 10, 0
021
TAN
25
022
4
4
023
*
20
024
÷
10
025
STO 3
44, 3
026
R/S
31
027
RCL 0
45, 0
028
RCL* 1
45, 20, 1
029
STO 4
44, 4
030
RTN
43, 32

Example:  R0 = n = 5, R1 = s = 4.  Output:  θ = 108°, A ≈ 27.5276, P = 20

This blog is property of Edward Shore,  2017.

RPN HP 12C: Fibonacci and Lucas Sequences

  RPN HP 12C: Fibonacci and Lucas Sequences Golden Ratio, Formulas, and Sequences Let φ be the Golden Ratio: φ = (1 + √5) ÷ 2...