Showing posts with label geometry. Show all posts
Showing posts with label geometry. Show all posts

Saturday, July 25, 2026

Earth's Radius by Latitude

Earth's Radius by Latitude




Introduction: Calculating the Earth’s Radius



In quick, general calculations, we assume that the shape of the Earth approximates the shape of sphere, with the radius to generally be approximated as 6371 km. However, the shape of the Earth is closer to an oblate ellipsoid. The Earth is flattened at the poles and bulges the greatest at the Equator.



There are several calculations to estimate the Earth’s radius given the latitude (degrees North or South from the Equator), this blog is working with the WGS 84 formula (see Source):



R = √[ ((a² * cos(φ))² + (b² * sin(φ))²) ÷ ((a * cos(φ))² + (b * sin(φ))²) ]



Which is simplified from:



R = √[ (a^4 + b^4 * tan²(φ)) ÷ (a² + b² * tan²(φ))



where:

φ: latitude (in degrees)

a: semi-major axis: 6378.137 km

b: semi-minor axis: 6356.7523142 km

R: radius of kilometers



HP 15C Code: Earth’s Radius by Latitude

Step; Key; Key Code

001: LBL E; 42, 21, 15

002: DEG; 43, 7

003: →H; 43, 2

004: TAN; 25

005: x²; 43, 11

006: STO 1; 44, 1

007: 6; 6

008: 3; 3

009: 7; 7

010: 8; 8

011: . ; 48

012: 1; 1

013: 3; 3

014: 7; 7

015: STO 2; 44, 2

016: 4; 4

017: 14; y^x

018: 6; 6

019: 3; 3

020: 5; 5

021: 6; 6

022: . ; 48

023: 7; 7

024: 5; 5

025: 2; 2

026: 3; 3

027: 1; 1

028: 4; 4

029: 2; 2

030: STO 3; 44, 3

031: 4; 4

032: y^x; 14

033: RCL 1; 45, 1

034: ×; 20

035: +; 40

036: RCL 2; 45, 2

037: x²; 43, 11

038: RCL 3; 45, 3

039: x²; 43, 11

040: RCL 1; 45, 1

041: ×; 20

042: +; 40

043: ÷; 10

044: √; 11

045: RTN; 43, 32



TI-60 Code: Earth’s Radius by Latitude

Step; Key; Key Code



Set degrees mode before beginning.



00: DMS-DD; 39

01: TAN; 34

02: x²; 96

03: STO; 61

04: 1; 01

05: ( ; 53

06: 6; 06

07: 3; 03

08: 7; 07

09: 8; 08

10: . ; 93

11: 1; 01

12: 3; 03

13: 7; 07

14: STO; 61

15: 2; 02

16: y^x; 45

17: 4; 04

18: +; 85

19: 6; 06

20: 3; 03

21: 5; 05

22: 6; 06

23: . ; 93

24: 7; 07

25: 5; 05

26: 2; 02

27: 3; 03

28: 1; 01

29: 4; 04

30: 2; 02

31: STO; 61

32: 3; 03

33: y^x; 45

34: 4; 04

35: ×; 25

36: RCL; 71

37: 1; 01

38: ) ; 54

39: ÷; 55

40: ( ; 53

41: RCL; 71

42: 2; 02

43: x²; 96

44: +; 85

45: RCL; 71

46: 3; 03

47: x²; 96

48: ×; 65

49: RCL; 71

50: 1; 01

51: ) ; 54

52: = ; 95

53: √; 86

54: R/S; 13

55: RST; 22



Examples



Latitude: 80° 00’; Radius (km): 6357.402412

Latitude: 57° 24’; Radius (km): 6362.996788

Latitude: 43° 40’; Radius (km): 6367.986902

Latitude: 9° 15’; Radius (km): 6377.588959

Latitude: 2° 56’; Radius (km): 6378.081467


Source


Planetcalc. “Earth Radius by Latitude (WGS 84)” Timur. 2021. https://planetcalc.com/7721/ Retrieved March 22, 2026.



Eddie


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

TI-60 and HP 65: Distance by Stadia Tacheometry

TI-60 and HP 65: Distance by Stadia Tacheometry




Introduction


The stadia calculation measures the distance from the level or theodolite (measuring device) to a graduated staff. Two readings are taken from the graduated staff, an upper reading (UR) and a lower reading (LR). The word tacheometry means "swift calculation". The distance between the theodolite and the staff is calculated as:


dist = k * s

k = is a factor taken of a radius of focal distance over image distance. Typically, k is set to 100, and will be assumed that k = 100 for these programs.

s = the difference between the upper reading and lower reading on the graduated staff. (UL - RL). The readings are assumed to be in meters.

If the theodolite is tilted at angle α, known as the vertical angle, then the distance becomes:

dist = k * s * cos² α


α is usually given in degrees-minutes-seconds and must be converted to decimal degrees.


TI-60 Program: Stadia Tracheotomy


Store before running: R1: UR (m), R2: LR (m), R3: α (D.MMSS)

Code:

00: 1 ; 01

01: 0 ; 00

02: 0 ; 00

03: × ; 65

04: ( ; 53

05: RCL; 71

06: 1 ; 01

07: - ; 75

08: RCL; 71

09: 2 ; 02

10: ) ; 54

11: × ; 65

12: RCL; 71

13: 3 ; 03

14: DMS-DD; 39

15: cos; 33

16: x²; 96

17: = ; 95

18: R/S; 13

19: RST; 22


HP 65 Program: Stadia Tracheotomy


Input Stack:

Z: vertical angle in degrees-minutes-second (V.MS)

Y: upper reading (UR)

X: lower reading (LR)

Code:

23: LBL

14: D

51: -

02: 2

32: f^-1

08: LOG (10^x)

71: ×

35 07: x<>y

32: f^-1

03: →D.MS (→DD)

31: f

05: COS

32: f^-1

09: √ (x²)

71: ×

24: RTN



Examples



Example 1:

V: 1°05' (Z stack, R3)

UR: 2.014 m (Y stack, R1)

LR: 1.668 m (X stack, R2)

Result: distance ≈ 34.5876 m



Example 2 (from HP 35):

V: 4°17' (Z stack, R3)

UR: 3.144 m (Y stack, R1)

LR: 1.761 m (X stack, R2)

Result: distance ≈ 137.5285 m



Example 3 (from HP 35):

V: -7°21' (Z stack, R3)

UR: 2.817 m (Y stack, R1)

LR: 0.731 m (X stack, R2)

Result: distance ≈ 205.1860 m



Sources



CivilFerba "Measure the distance by stadia method" Video posted on YouTube on December 8, 2018. https://www.youtube.com/watch?v=oon5ayl9DYs Retrieved March 22, 2026



HP-35 Surveying. Hewlett Packard. Buchs, Switzerland. February 1973. pp. 19-20



fx-FD10 Pro. User's Guide. Casio. Tokyo, Japan. 2014. pg. α-16 (alpha-16)



Eddie


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

HP 32SII: Volume of a Square Frustum (Three Approaches in RPN)

HP 32SII: Volume of a Square Frustum (Three Approaches in RPN)







The volume of a square frustum is:


v = height ÷ 3 × (s1^2 + s2^2 + √(s1^2 × s2^2))


which is based off the formula for the volume of general frustum:


v = height ÷ 3 × (base_area_1 + base_area_2 + √(base_area_1 × base_area_2))



Here are three approaches, which were all done with a HP 32SII calculator. The beauty of RPN is on display here. The three programs are labeled A, C, and D.


s1, s2: side of the square base h: height

Stack: Z: s1 Y: s2 X: h



Program A: (24 steps, 36 bytes) 

V = h/3 * (s1^2 + s2^2 + √(s1^2 * s2^2))


LBL A

STO H

R↓

x<>y

ENTER

ENTER

CLx

-

R↓

x<>y

R↓

×

R↓

+

R↑

+

RCL H

×

3

÷

RTN


Program C: (17 steps, 25.5 bytes)

Note: √(s1^2 * s2^2) = s1 * s2

V = h/3 * (s1^2 + s2^2 + (s1 * s2))


LBL C

ENTER

3

÷

R↓

×

LST x

x<>y

R↓

x<>y

+

R↑

+

×

RTN



Program D: (15 steps, 22.5 bytes) 

Note: s1^2 + s2^2 + s1 * s2 = s1^2 + s2^2 + 2 * s1 * s2 – s1 *s2 = (s1 + s2)^2 - s1*s2 

V = h/3 * ((s1 + s2)^2 - s1 * s2)



LBL D

3

÷

R↓

×

LST x

x<>y

R↓

+

R↑

-

×

RTN



Examples



Example 1:

s1: 24

s2: 30

h: 5.8

Result: 4245.6



Example 2:

s1: 2.54

s2: 12.15

h: 10

Result: ≈ 616.4503





Eddie


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

Numworks (Python): Parallelograms Described by Vectors

Numworks (Python): Parallelograms Described by Vectors



Introduction



The script drawpgram.py draws a parallelogram constructed by a pair of two-dimensional vectors. Both vectors original from the origin of the Cartesian plane ([0, 0]). Let the two vectors be labeled as [x1, y1] and [x2, y2].



This script also calculates the area and perimeter of the constructed parallelogram consisting of the end points (0,0), (x1, y1), (x2, y2), and (x1+x2, y1+y2).







Then the perimeter of the parallelogram is calculated as:

perimeter = 2 * (norm([x1, y1] + norm[x2, y2]) = 2 * (√(x1 + y1) * √(x2, y2))



And the area is calculated as:

area = abs(det([[x1, y1] [x2, y2]])) = abs(x1 * y2 – x2 * y1)





Numworks Script: drawpgram.py

Modules used: Math, PyPlot



Script page: https://my.numworks.com/python/ews31415/drawpgram



# Draw a parallelogram with two vectors

# Edward Shore, 2/15/2026

# Numworks

# drawpgram.py



from math import *

from matplotlib.pyplot import *



print("Draw a parallelogram with 2 vectors")

x1=eval(input("x1? "))

y1=eval(input("y1? "))

x2=eval(input("x2? "))

y2=eval(input("y2? "))



# Area

area=abs(x1*y2-x2*y1)



# Perimeter

perim=2*((x1**2+y1**2)**(1/2)+(x2**2+y2**2)**(1/2))





minx=min([x1,x2,x1+x2,0])

maxx=max([x1,x2,x1+x2,0])

miny=min([y1,y2,y1+y2,0])

maxy=max([y1,y2,y1+y2,0])



axis((minx-1,maxx+1,miny-1,maxy+5))



plot([0,x1],[0,y1],'blue')

plot([0,x2],[0,y2],'purple')

plot([x1,x1+x2],[y1,y1+y2],'purple')

plot([x2,x1+x2],[y2,y1+y2],'blue')



str1="area = {0:.6f}".format(area)

text(minx-1,maxy+4.5,str1)



str2="perim = {0:.6f}".format(perim)

text((minx+maxx)/2,maxy+4.5,str2)



show()



Notes:

1. I use eval(input( “prompt” )) and importing the Math module to allow for expressions to be entered, such as expressions involving pi (π). If I use float(input( “prompt” )) instead, only numbers would be allowed.

2. For the purposes of display, the results are rounded off to six decimal places ({0:.6f}) and displayed in a line. The full precision results of area and perimeter are stored in the variables area and perim, respectively.



Examples



Example 1: [2, 4], [5, 2]



Example 2: [-3, 1], [5, 3]



Example 3: [-6, 0], [0, -4]



Source

Margalit, Dan and Joseph Rabinoff. 2025. “Determinants and Volumes” Interactive Linear Algebra LibreTexts. Accessed February 8, 2026. https://math.libretexts.org/Bookshelves/Linear_Algebra/Interactive_Linear_Algebra_(Margalit_and_Rabinoff)/04%3A_Determinants/4.03%3A_Determinants_and_Volumes



Eddie


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

HP 15C: Distance and Slope Between Two Points Using Polar Conversion and the Stack

HP 15C: Distance and Slope Between Two Points Using Polar Conversion and the Stack



HP 15C Program: Distance and Slope



This short program calculates the slope and distance between two Cartesian points (x1, y1) and (x2, y2) using the four level stack and rectangular-polar conversion. The code can be adopted to other Hewlett Packard, Swiss Micros, and other RPN with four-stacks. RPL will need a short adjustment.



Input Stack:

T: y2

Z: x2

Y: y1

X: x1



Code:

LBL A

001

42, 21, 11

Program start

X<>Y

002

34


R↓

003

33


-

004

30


R↓

005

33


-

006

30


CHS

007

16


R↑

008

43, 33

Y: Δy, X: Δx

→P

009

43, 1

Rectangular to polar conversion; calculate distance

X<>Y

010

34


TAN

011

25

Calculate slope

X<>Y

012

34


RTN

013

43, 32

Program end









Reference formulas



Distance = √((x2^2 – x1^2) + (y2^2 – y1^2))

Slope = (y2 – y1) ÷ (x2 – x1) = tan(Θ)



Derivation:

Let y’ = y2 – y1 and x’ = x2 – x1

Then by rectangular to polar function, angle:

Θ = arctan( y’ / x’ )

tan Θ = y’ / x’

tan Θ = (y2 – y1) ÷ (x2 – x1)



Examples



Example 1: (-3, 8) to (11, 16)

Stack:

T: 16

Z: 11

Y: 8

X: -3

Result:

Y: slope ≈ 0.5714

X: distance ≈ 16.1245



Example 2: (5, 6) to (7, 9)

Stack:

T: 9

Z: 7

Y: 6

X: 5

Result:

Y: slope = 1.5000

X: distance ≈ 3.6056


Eddie


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

TI-60 Geometry: Intersection and Angle Between Two Lines

TI-60 Geometry: Intersection and Angle Between Two Lines


We have two lines in the standard form:


y = R1 * x + R2

y = R3 * x + R4


where R1, R3 are the slopes and R2, R4 are the y-intercepts, which are stored prior to executing the programs.


TI-60: Intersection Point


x = (R4 – R3) / (R1 – R3), y = R1 * x + R2


Step Key Code

Key

Step Key Code

Key

00 53

(

14 54

)

01 71

RCL

15 95

=

02 04

4

16 13

R/S

03 75

-

17 65

×

04 71

RCL

18 71

RCL

05 02

2

19 01

1

06 54

)

20 85

+

07 55

÷

21 71

RCL

08 53

(

22 02

2

09 71

RCL

23 95

=

10 01

1

24 13

R/S

11 75

-

25 22

RST

12 71

RCL



13 03

3






TI-60: Angle Between Two Lines


Θ = arctan(abs((R1 – R3) / (1 + R1 * R3)))


Step Key Code

Key

Step Key Code

Key

00 53

(

13 65

×

01 71

RCL

14 71

RCL

02 01

1

15 03

3

03 75

-

16 54

)

04 71

RCL

17 95

=

05 03

3

18 96

06 54

)

19 86

√x

07 55

÷

20 12

R/S

08 53

(

21 34

RST

09 01

1



10 85

+



11 71

RCL



12 01

1




Examples


Intersection Point: (x, y)

Angle: Θ (degrees)

y = -2 * x + 3

y = 3 * x + 4

(-0.2, 3.4)

45°

y = x + 8

y = 3 * x – 6

(7, 15)

26.56505118°

y = 4 * x – 6

y = 2 * x + 1

(3.5, 8)

12.52880771°



May I close with this: Happy Birthday, Susan Sarandon!


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.

First Look: HP 16C Collector's Edition

 First Look: HP 16C Collector's Edition I just got the HP 16C Collector's Edition.   This is the famous HP 16C that specializes in c...