Showing posts with label distance. Show all posts
Showing posts with label distance. Show all posts

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.



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.

Monday, January 5, 2026

Casio fx-CG 100 Python: Clothoid Curve Analysis

Casio fx-CG 100 Python: Clothoid Curve Analysis



Introduction



The clothoid is a mathematical curve where its curvature is in proportion to the distance traveled from the origin. This property allows the curve to serve many applications including connecting railways, designing roller coasters, and traffic distribution.







Let:

L: arc length of the curve traveled

R: radius from the center of the clothoid to the point on the curve

(x, y): point on the clothoid curve with curve length L and radius R

A: parameter, where A = √(R * L)

Θ: angle between the radius and line of the center point and a point on the x-axis, where Θ = L^2 ÷ (2 * A^2)



The point on the curve is determined by a variation of the Fresnel Integrals:

x = A * √2 * ∫( cos(u^2) du, u = 0 to u = t)

y = A * √2 * ∫( sin(u^2) du, u = 0 to u = t)



The Python program uses infinite series to calculate the point (x, y).



The Clothoid curve is also known as the Cornu spiral or the Euler spiral.


Casio fx-CG 100 Program: clothoid.py


# Clothoid Curve Analysis

# template of infinite series

# Eddie W. Shore, 11/23/2025


from math import *


# factorial function

def fact(n):

  f=1

  if n<=1:

    return 1

  else:

    for i in range(2,n+1):

      f*=i

    return f


# main program

print("Clothiod Analysis\nCornu Spiral")

r=eval(input("radius: "))

l=eval(input("arc length: "))

a=sqrt(r*l)

t=l**2/(2*a**2)


# c: cosine, s=sine

c=0

s=0

# set term artificially high

w=100

# set counter at beginning

n=0

# series loop

while abs(w)>=1e-20:

  cc=(-1)**n*t**(4*n+1)/(fact(2*n)*(4*n+1))

  ss=(-1)**n*t**(4*n+3)/(fact(2*n+1)*(4*n+3))

  w=max(cc,ss)

  c+=cc

  s+=ss

  n+=1

# answer

x=a*sqrt(2)*c

y=a*sqrt(2)*s

print("constant: {0:.12f}".format(a))

print("angle: {0:.12f}".format(t))

print("x: {0:.12f}".format(x))

print("y: {0:.12f}".format(y))


Example


Input:

Radius: r = 1.75

Arc Length: l = 4.00


Results:

constant (a): 2.645751311065

angle (degrees): 1.142857142857°

x: 3.602081584381

y: 1.646831998544



Sources


Autodesk, Inc. “About Spiral Definitions” Autodesk Civil 3D Help. https://help.autodesk.com/view/CIV3D/2025/ENU/?guid=GUID-DD7C0EA1-8465-45BA-9A39-FC05106FD822. 2025. Retrieved November 19, 2025.


Constantin. “The Clothoid” A railway track blog. https://railwaytrackblog.com/2016/07/03/the-clothoid/comment-page-1/ March 7, 2016. Retrieved November 19, 2025.


Gombáu, Alberto. “The clothoid: geometry that unites mathematics, engineer and design”. https://medium.com/@gombau/the-clothoid-geometry-that-unites-mathematics-engineering-and-design-6323de37e979. April 11, 2025. Retrieved November 19, 2025.



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, August 10, 2025

The Product Formula Chart Aid: P = A × B

The Product Formula Chart Aid: P = A × B


A Learning and Memorization Aid


A lot of mathematical formulas, basic relationships in physics and other applications are often in the form of:


P = A × B


where P is the product of two factors, A and B.


Examples include:


Distance: distance = velocity × time

Ohm’s Law: power = current × voltage

Newton’s Second Law: force = mass × acceleration


A chart in a shape of a circle (some people use a triangle) can be used to illustrate the relationship between the three variables.  I see charts of this time in various math books and videos applied to many applications.  An example is Ohm's Law as illustrated by Electrician U (skip to https://youtu.be/-oHzc_DbaGw?t=17).


P = A × B,  A = P ÷ B,  B = P ÷ A



Going across means multiply, while vertically means divide.


P = A × B

A = P ÷ B

B = P ÷ A





Hope you find this helpful,


Eddie


Source:  

Electrician U.  "5 Formulas Electricians Should Have Memorized!"  March 15, 2023.   https://www.youtube.com/watch?v=-oHzc_DbaGw.  Accessed May 27, 2025


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.


All posts are 100% generated by human effort.  The author does not use AI engines and never will.


Saturday, September 7, 2024

HP Prime: Minimum Distance Between a Point and a Line

HP Prime: Minimum Distance Between a Point and a Line



Introduction


We have a line in the form of y = m * x + b, where m is the slope of the line and b is the y-intercept of the line, and a separate point (px, py). The task is to find the minimum distance, or the shortest distance, between the point and the line. The separate point is not required to be on the line. The line and point are in two-dimensional space.


If the point (px, py) is not on the line, then theoretically, there are an infinite amount of distances between the point and the line. However, to get the shortest distance, draw a path that is “directly straight” to the line. This is achieved by choosing a line that connects the (px, py) that is a line that is orthogonal (perpendicular) to the line y = m * x + b.





The line drawn is of the form y = -1/m * x + b1. The slope of the orthogonal line is -1/m. Assuming that m ≠ 0, the y-intercept of the orthogonal line is b1 = y1 + x1 / m.


The next step is to find where the two lines intersect, which is done by solving the following system for x and y:


y = m * x + b

y = -m / n + b1


Label the intersection point (x1, y1). The minimum distance will be calculated as follows:


dist = √( (x1 – px)^2 + (y1 – py)^2 ) = abs( (x1 – px) + (y1 – py)*i)



If m = 0, the line is in the form of y = b. The orthogonal line is x = px, and the distance is simply abs( (y1 – py)*i ).



HP Prime Code: PTLNDIST


EXPORT PTLNDIST()

BEGIN

// 2024-07-21 EWS



// radian

HAngle:=0;



LOCAL px,py,m,b;



INPUT({m,b,px,py},

"Point-Line Distance (px, py), y=mx+b",

{"m:","b:","px:","py:"},

{"m: slope"," b: y-intercept",

"point x","point y"});



LOCAL y0;

y0:=m*px+b;


LOCAL b1,mt,x1,y1,dist,str;

IF m≠0 THEN

b1:=py+px/m;

mt:=[[−m,1],[1/m,1]]^-1*[[b],[b1]];

x1:=mt[1,1];

y1:=mt[2,1];

dist:=ABS((x1-px)+(y1-py)*√(-1));

ELSE

x1:=px;

y1:=b;

dist:=ABS((y1-py)*√(-1));

END;



// print results

PRINT();

PRINT("Results:");

PRINT("Intersect point:");

PRINT("x: "+STRING(x1));

PRINT("y: "+STRING(y1));

PRINT("");



IF m≠0 THEN

str:="Y="+STRING(-1/m)+"*X+"+STRING(b1);

ELSE

str:="X="+STRING(x1);

END;



PRINT("Orthogonal Line:");

PRINT(str);

PRINT("");

PRINT("Minimum Distance:");

PRINT(dist);



RETURN {x1,y1,str,dist};

END;


Note:


√(-1) represents the imaginary number ⅈ ( [ Shift ], [ 2 ] ).


Inputs:


* The slope of the y-intercept of the line y = m * x + b (no vertical lines, but m can be zero)

* The point (px, py)


Outputs:


* The line that runs through point (px, yx) that is orthogonal to y = m * x + b. The slope and y-intercept of the orthogonal line, which the line will be stated in a string

* The intersection point of the two lines.

* The distance between (px, yx) and the intersection point. (dist)



Examples


Example 1:

Inputs: Line: y = 5 x – 2, Point: (-1, -5)

m = 5

b = -2

px = -1

py = -5


Results:

Intersect point:

x = -0.615384615386

y = -5.07692307692

Orthogonal Line:

Y = -0.2 * X – 5.2

Minimum distance:

0.392232270274



Example 2:

Inputs: Line: y = 6, Point: (3, -9)

m = 0

b = 6

px = 3

py = -9


Results:

Intersect point:

x = 0.764705882353

y = 4.05882352941

Orthogonal Line:

X = 3

Minimum distance:

15



Example 3:

Inputs: Line: y = 4 x + 1, Point: (5, 3)

m = 4

b = 1

px = 5

py = 3


Results:

Intersect point:

x = 0.764705882353

y = 4.05882352941

Orthogonal Line:

Y = -0.25 * X + 4.25

Minimum distance:

4.36564125066


Source

Tremblay, Christopher. Mathematics for Game Developers. Thomson Course Technology. Boston, MA. 2004. ISBN 1-59200-038-X.


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.

Monday, April 11, 2022

Retro Review: Calculated Industries NautiCalc Plus

 Retro Review:   Calculated Industries NautiCalc Plus









Quick Facts:


Model:  NautiCalc Plus

Company:  Calculated Industries

Years:  1996-1998

Type:  Nautical

Batteries: 1 x CR-2032

Operating Mode:  Chain

Memory Registers: 10


Features


For a company that produces specialized calculators, the NautiCalc Plus is a rare calculator.   I purchased mine from Calculator Source's eBay page.   Calculations that the NautiCalc offers are:


*  conversions of time

*  conversions of distance

*  conversions of speed

*  triangulation calculations:  course direction, 1st bearing, 2nd bearing, distance of the bearing object, distance abeam

*  solver:  speed, distance, time

*  solver:  tank capacity in gallons, fuel efficiency (statute miles per gallon), range (how far can you travel with a fuel tank)

*  paperless tape with the capacity of 10 entries, accessed by the [ Rcl ] [ = ], which is not marked on the calculator.   Scroll the entries by the plus and minus keys.  


Memory Registers


The NautiCalc has ten memory registers, M0 through M9.   What is unusual is that the [ Stor ] key acts a memory-plus for M0.   For example:


[ Conv ] [ + ] (Clr Mem)

25 [ Stor ] 0  (M-0   25)

[ Stor ] 1    (M-1  25)

50 [ Stor ] 0  (M-0  50)

[ Stor ] 1  (M-1 50)


[ Rcl ] 0   (M-0 75)   75 is stored in M0,  50 and 25 were added together

[ Rcl ] 1   (M-1 50)   50 is stored in M1, 50 replaced 25 in M1


Miles


There are two measurements for miles:  statute miles and nautical miles.   Statue miles, also known as survey miles, are miles related to road distance, equal to 5,280 feet.   Nautical miles, which are used in sailing and air travel, are measure from 1% of 1 degree of the Earth's curvature (see source, "What Are Statute Miles?").   


Statue Miles:  [ Conv ] [ 7 ]


Nautical Miles:  [ Miles ]


1 nautical mile ≈1.1507794 statute mile


Entering Time 


Time can be entered with several ways:


*  [ AM ] and [ PM ] keys.  We can use the shortcut method hhmmss or hhmm format to enter time.

*  The colon [ : ] key.   

*  The use hours, minutes, and second keys ([ Hr ], [ Min ], [ Sec ]).  


The [ Conv ] [ : ] changes the time format between 12-hour and 24-hour military time format.  


If we want to enter degrees-minutes-seconds, we must use the [ d:m:s ] key.  


Stopwatch 


The stopwatch can be started and stopped with the [ Timer ] key twice.  The stopwatch also has a split/lap feature with the [ S/Lap ].  While the stopwatch is running, a clock icon is on the display.


Timer


The timer is started with pressing the [ Timer ] key, entering the time, then pressing the [ Timer ] key again.   The NautiCalc Plus has a buzzer, not very loud, that can be turned on and off.  While the timer is going, we see a clock and star on the display.  The entire display flashes when the timer is completed. 


Not many calculators as a whole have the stopwatch and timer, so to have it is a nice feature.  


Now let's demonstrate some of the main calculations that are done wiht the NautiCalc Plus.  


Example:  Fuel Efficiency


If a tank can carry 15 gallons and has an average efficiency of 30 miles per gallon, what is the range?


[ On/C ] [ On/C ]

15 [ Conv ] [ Speed ] (Cap) (display has GAL)

30 [ Conv ] [ Time ] (Eff)   (display has MPG)

[ Conv ] [ Dist ] (Range)

Result:  RNG:  450 MI S  (450 statute miles)


Example:  Distance of Objects and Abeam


Traveling with 30° course with bearings reading 45°12' and 58°42', respectively.   You have traveled 5 nautical miles.   Find the distance bearing from the bearing object and distance abeam.  


[ On/C ] [ On/C ]

30 [ Course° ]   (CRSE)

45 [ d:m:s ] 12 [ 1stϕ ]  (BRG1)

58 [ d:m:s ] 42 [ 2ndϕ ] (BRG2)

5 [ Miles ] [ Dist ] (DIST   5  N MI)

[ Dist ]    (Display:   TRVL 5  N MI)

[ Dist ]    (Display:  DOBJ 5.6156432 N MI)

[ Dist ]    (Display:  BEAM 3.1139547 N MI)


TRVL:  distance traveled

DOBJ:  distance from object

BEAM:  distance abeam


Example:  Speed/Time/Distance 


If a boat travels 13.5 nautical miles and it took 2 hours 23 minutes, what is the speed of the boat?


[ On/C ] [ On/C ]

13.5 [ Miles ] [ Dist ]

2 [ Hr ] 23 [ Min ] [ Time ]

[ Speed ] 

Display:  SPD 5.6643357 K NO T  (5.6643357 knots, 6.5184011 miles an hour)



Closing Thoughts


The keyboard is solid with the keys have a nice feel to them.  The NautiCalc Plus comes with a protective wallet, where the user guide can fit in the pockets.   


I really like this calculator and how Calculated Industries makes calculators for specific applications.  I would have loved to have seen the NautiCalc had a longer life than it did.   It's really cool to collect.  


I'm now retired from purchasing vintage calculators online.  I still will be posting retro reviews in the next few months, including the recently purchased the Texas Instruments TI-57 LCD (1982) and HP 45 (1973).  I am also going to include calculators that have been sitting in the garage that I didn't get a chance to do a review on, such as the Radio Shack EC-4026 (Casio fx-4500P equivalent) and TI-65.  

Source:


Bollman, Mark.  "NautiCalc Plus" April 21, 2013.   Last Accessed March 24, 2022.  http://mathcs.albion.edu/~mbollman/CI/NCalc+.htm  


Jones, Louise.  "What Are Statute Miles?"   Sciencing.  April 25, 2017.  Last Accessed March 27, 2022.  https://sciencing.com/statute-miles-8358166.html  



Until next time,


Eddie


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


HP 71B Basic and Casio fx-CG 100: Weighted Random Sample

HP 71B Basic and Casio fx-CG 100: Weighted Random Sample Introduction In calculators, it is fairly easy to generate a rand...