Showing posts with label chord length. Show all posts
Showing posts with label chord length. Show all posts

Sunday, September 7, 2025

Basic vs. Python: Circle Inscribed in Circle [HP 71B, Casio fx-CG 100]

Basic vs. Python: Circle Inscribed in Circle



Calculators Used:

Basic: HP 71B

Python: Casio fx-CG 100


Introduction






Let a rectangle with sides A and B be inscribed in a circle. The circle has a radius R. Let the line segments with the length A have a corresponding angle Θ. If we are given R and Θ, we can use the chord length formula to calculate A and B.


The angle corresponding with side B can be determined as:

φ: angle corresponding with side B


φ + Θ + φ + Θ = 360°

2 × (φ + Θ) = 360°

φ + Θ = 180°

φ = 180° - Θ


Chord length:


A = 2 × R × sin(Θ/2)

B = 2 × R × sin(φ/2) = 2 × R × sin((180° - Θ)/2)


Knowing A and B, we can calculate the following:


Area of the rectangle = A × B

Area of the shaded area (circle – rectangle) = π × R^2 – A × B



Basic: HP 71B – INSCRECT


10 DESTROY R,A,B,C,D,T

15 DEGREES @ FIX 5

20 DISP “RECT. INSCR. CIRCLE” @ PAUSED

25 DISP “DEGREES MODE” @ WAIT 0.5

30 INPUT “RADIUS? “; R

35 INPUT “ANGLE-SIDE A? “; A


50 A = 2 * R * SIN(T/2)

55 B = 2 * R * SIN((180 – T)/2)

60 C = A * B

65 D = R^2 * PI – C


80 DISP “SIDE A = “, A @ PAUSE

85 DISP “SIDE B = “, B @ PAUSE

90 DISP “RECT ANGLE = “, C @ PAUSE

95 DISP “CIRC-RECT = “, D @ PAUSE

98 STD



Notes:

* FIX 5: Fix 5 display

* STD: Standard mode, floating point display

* DEGREES: Sets the HP 71B in degrees mode



Python: Casio fx-CG 100, insecrect.py



from math import *

print(“Rectangle Inscribed in a Circle”)

print(“Math module imported”)

r=eval(input(“Radius? “))

print(“Enter angle in degrees”)

t=eval(input(“Angle- A? “))

u=t*pi/180

a=2*r*sin(u/2)

b=2*r*sin((pi-u)/2)

c=a*b

d=r**2*pi-c

print(“A: {0.5f}”.format(a))

print(“B: {0.5f}”.format(b))

print(“Rect. Area: {0.5f}”.format(c))

print(“CIRC-AREA: {0:.5f}”.format(d))



Notes:

* Since the math module is used, this script can be used in any calculator with Python.

* Python’s angle mode is always in radians.



Examples



Example 1:

Inputs:

r = 10

Θ = 30°

Outputs:

a ≈ 5.17638

b ≈ 19.31852

c = 100

d ≈ 214.15927



Example 2:

Inputs:

r = 20

Θ = 80°

Outputs:

a ≈ 25.71150

b ≈ 30.64178

c ≈ 787.84620

d ≈ 468.79086



Example 3:

Inputs:

r = 20

Θ = 90°

Outputs:

a ≈ 35.35534

b ≈ 35.35534

c = 1250

d ≈ 713.49541



Eddie


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


The author does not use AI engines and never will.

Sunday, April 28, 2024

TI 30Xa Algorithms: Fundamental Horizontal Circle Calculations

 TI 30Xa Algorithms: Fundamental Horizontal Circle Calculations



Introduction and Formulas





Given the following:


r = radius of the curve

Δ = central angle, or the angular sweep of the curve. The angle is usually given in whole degrees or in surveying, degrees-minutes-seconds.


We can calculate the following:


The length of the tangent line to the central meeting point:

t = r × tan( Δ / 2 )


The linear distance from where the curve begins to the point the curve ends, known as the chord distance:

c = 2 × r × sin( Δ / 2 )


The distance of the curve from the end points, known as the arc length:

s = (Δ° / 180°) × π × r


Note the formula for arc length assumes that the angle is in degrees. If the angle is in radians, the formula for arc length reduces to s = Δ rad × r.



Procedure


The procedure is made for the TI-30Xa, where we can take advantage of the three memory registers it has. You can use another calculator, except most basic scientific calculators only have one memory register; you will just have type in one of the extra variables.


1. Check the angle mode. We should be in degrees mode, which is indicated by the DEG indicator. If not, press the [ DRG ] key until degrees mode is selected.


2. Enter the central degree (Δ).


If the degree is in whole degrees, just enter the angle and store into memory register 1. ( [ STO ] [ 1 ] ).


If the degree is in degrees-minutes-seconds format (known as DMS or sometimes as HMS), enter the angle in DD.MMSSS format. Then press [ 2nd ] [ + ] {DMS>DD} to convert the angle into whole degrees. Then store the result into memory register 1.


3. Enter the radius length and store in memory register 2. ( [ STO ] [ 2 ] ).


Memory registers:

M1 = Δ; M2 = r


4. Calculate the tangent length, t:


[ ( ] [ RCL ] 1 [ ÷ ] 2 [ ) ] [ TAN ] [ × ] [ RCL ] 2 [ = ]


5. Calculate the chord distance, c:


2 [ × ] [ RCL ] 2 [ × ] [ ( ] [ RCL ] 1 [ ÷ ] 2 [ ) ] [ SIN ] [ = ]


6. Calculate the arc length, s:


[ RCL ] 1 [ × ] [ π ] [ × ] [ RCL ] 2 [ ÷ ] 180 [ = ]


Examples


Let’s assume for the following examples Degrees mode is set (DEG).


Example 1:

r = 150 ft (it can be any length unit as long as you keep it consistent)

Δ = 60° (whole degrees)


60 [ STO ] 1

150 [ STO ] 2


t: [ ( ] [ RCL ] 1 [ ÷ ] 2 [ ) ] [ TAN ] [ × ] [ RCL ] 2 [ = ]

t = 86.60254038 ft


c: 2 [ × ] [ RCL ] 2 [ × ] [ ( ] [ RCL ] 1 [ ÷ ] 2 [ ) ] [ SIN ] [ = ]

c = 150 ft

(In this case, the chord length is the same as the radius. Why? There is a geometric reason.)


s: [ RCL ] 1 [ × ] [ π ] [ × ] [ RCL ] 2 [ ÷ ] 180 [ = ]

s = 157.0796327 ft



Example 2:

r = 324 ft

Δ = 92°22’18” (92 degrees, 22 minutes, 18 seconds)


92.2218 [ 2nd ] [ + ] {DMS>DD} [ STO ] 1

324 [ STO ] 2


t: [ ( ] [ RCL ] 1 [ ÷ ] 2 [ ) ] [ TAN ] [ × ] [ RCL ] 2 [ = ]

t = 337.6968953 ft


c: 2 [ × ] [ RCL ] 2 [ × ] [ ( ] [ RCL ] 1 [ ÷ ] 2 [ ) ] [ SIN ] [ = ]

c = 467.5897175 ft


s: [ RCL ] 1 [ × ] [ π ] [ × ] [ RCL ] 2 [ ÷ ] 180 [ = ]

s = 522.3494689 ft



Source

Hewlett-Packard Company. HP-46 sample applications. Loveland, CO. February 1,1975. Part No. 00046-90018. pg. 104-105



Happy Birthday, Smokey!


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, February 16, 2020

Casio fx-3650P: Circular Segment

Casio fx-3650P: Circular Segment

Introduction





Variables:
X:  radius
Y:  angle (in degree)
C:  chord length
D:  altitude
A:  area
B:  arc length

Program 1:  Given Chord Length and Altitude

Calculate:  Radius, Angle, Area, Arc Length

? → C : ? → D : Deg :
( ( C ÷ 2 )^2 + D^2 ) ÷ ( 2D ) → X ◢
2 cos^-1 ( ( X - D ) ÷ X ) → Y ◢
X^2 ÷ 2 * ( π Y ÷ 180 - sin Y ) → A ◢
X Y π ÷ 180 → B

Example:
Input C = 8,  D = 11.75

X:  6.555851064 (radius)
Y:  284.8004594 (angle)
A:  127.5950317 (area)
B:  32.58720643 (arc length)

Program 2:  Given Radius and Angle

Calculate:  Chord Length, Altitude, Area, Arc Length

? → X : ? → Y : Deg :
2 * sin(Y ÷ 2) → C ◢
2 X ( sin(Y ÷ 4))^2 → D ◢
X^2 ÷ 2 * ( π Y ÷ 180 - sin Y ) → A ◢
X Y π ÷ 180 → B

Example:
Input X = 17.25, Y = 204

C:  33.74609223 (chord length)
D:  20.83647667 (altitude)
A:  590.2462124 (area)
B:  61.41813638 (arc length)

Source:

John W Harris and Horst Stocker.  Handbook of Mathematics and Computational Science Spring:  New York.  2006 ISBN 978-0-387-94746-4

Announcement

I am going to have surgery this week and my family is having medical issues.  I will be taking some time off in the next few weeks.  Tomorrow I have a special post reviewing the classic TI-30 from 1976. Take care everyone and thank you so much for your support.  I love doing this blog. 

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, May 18, 2016

Geometry: The Sagitta in Circles

Geometry:  The Sagitta in Circles

When the word Sagitta is mentioned, we would associate sagitta with a small constellation between the constellations Aquila and Cygnus.  Sagitta is one of the smallest constellations in astronomy.  In mythology, the Sagitta refers to an arrow, involved in a number of myths:  (1) the arrow Hercules used to kill an eagle to free Prometheus, (2) the arrow used by Apollo to avenge Asclepius’ death, and (3) the arrow Eros used to shoot Zeus to make him fall in love with Ganymede. 

But did you know that sagitta was referred to a length in geometry.  The sagitta is the length from the center of a circular arc to its base (defined by the circle’s chord). 



Variables: 
r = radius of the circle
c = chord length
s = sagitta
θ = angle between radius and line that connects center to end-chord line (see the diagram above)

Derivation:  Calculating the length of the sagitta

Given radius and angle:

cos θ = (r – s) / r
r * cos θ = r – s
s = r – r cos θ
s = r * (1 – cos θ)

Example:  r = 5, θ = 60°

s = 5 * (1 – cos 60°)
s = 2.5

Given radius and chord length:

(r – s)^2 + (c/2)^2 = r^2
(r – s)^2 = r^2 – (c/2)^2
r – s = √(r^2 – (c/2)^2)
s = r - √(r^2 – (c/2)^2)

Example:  c = 10, r = 6

s = 6 - √(6^2 – (10/2)^2)
s ≈ 2.68338

Sources:

“Sagitta (geometry)”.  Wikipedia.  https://en.wikipedia.org/wiki/Sagitta_(geometry)  Retrieved May 6, 2016

“Sagitta Constellation”  Constellation Guide.  Constellations:  A Guide to the Night Sky  http://www.constellation-guide.com/constellation-list/sagitta-constellation/   Retrieved May 18, 2016


This blog is property of Edward Shore, 2016.

Sunday, May 19, 2013

HP35S: Horizontal Curve - Finding Radius, Chord Length, and Arc Length

HP 35S: Horizontal Curve
Original: HP 33S Surveying Applications, Hewlett Packard, March 1978, pg. 46


Calculator
HP 35S

Input
(see diagram above)

T = Tangent Distance (length of segment from P.C. (Point of Curvature) to P.I. (Point of Tangent Intersection))
A = Central curve in degrees, minutes, seconds

This program prompts for tangent length and central angle

Output

The program gives the following results:
1. Radius of the horizontal curve (R)
2. Press R/S to get the Chord length (C)
3. Press R/S once more to get the arc length of the horizontal curve (L)

The program does not store any results.

Formulas
R = T × (tan(A/2))⁻¹
C = 2 × R × sin(A/2)
L = R × A in radians

Where
T = tangent distance
A = central angle
R = Radius
C = Chord Length
L = Arc Length

Example
Tangent Length: 172.45
Central Angle: 40°22'13" (enter as 40.2213)

Results:
Radius: 469.08079
Chord Length: 323.7172
Arc Length: 330.51163

Program
V001 LBL V
V002 DEG
V003 INPUT T
V004 INPUT A
V005 HMS→\\ sometimes named ->H
V006 STO A
V007 2
V008 ÷
V009 TAN
V010 1/x
V011 ×
V012 R/S \\ display Radius
V013 ENTER
V014 ENTER
V015 2
V016 ×
V017 RCL A
V018 2
V019 ÷
V020 SIN
V021 ×
V022 R/S \\ display Chord Length
V023 x<>y
V024 RCL A
V025 ->RAD
V026 ×
V027 RTN \\ display Arc Length


If you don't have the ->RAD function, you can substitute the following steps:
π, ×, 180, ÷

This blog is property of Edward Shore. 2013

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...