Showing posts with label calculus. Show all posts
Showing posts with label calculus. Show all posts

Saturday, May 16, 2026

Python (TI-84 Plus CE) and Swiss Micros DM32: The Integral of y = abs(r * x + s)

Python (TI-84 Plus CE) and Swiss Micros DM32: The Integral of y = abs(r * x + s)




The Integral of y = abs(r * x + s)



This algorithm calculates the integral of ∫ abs(r * x + s) dx, from x = a, x = b), where r and s are constants. For clarity, I am using abs to stand for absolute value instead of the customary pipe characters (|x|).



Let the function y = abs(r * x + s). Then the function can be defined as a piecewise function (without loss of generality):

y =

{ -(r * x + s), x < xc

{ (r * x + s), x ≤ xc



The point x = xc is the critical point because it is the root (zero) of this function:

abs(r * x + s) = 0

Because abs(0) = 0:

r * x + s = 0

r * x = -s

x = -s/r



and:

-(r * x + s) = 0

r * x + s = 0

x = -s/r



Let the critical point xc = -s/r



Taking the indefinite integral of y(x) yields:

∫ y(x) dx =

{ -r * x^2 ÷ 2 – s * x + C, x < xc

{ r * x^2 ÷ 2 + s * x + C, x ≥ xc

and C is an arbitrary integration constant.



Let f(x) = r * x^2 ÷ 2 + s * x and find the definite integral from x = a to x = b.



Case 1: a ≥ xc and b ≥ xc, where both a and b are greater than the critical point. This is the simplest case.



∫ ( r * x + s dx, x = a to x = b)

= (r * b^2 ÷ 2 + s * b) - (r * a^2 ÷ 2 + s * a)

= f(b) – f(a)



Case 2: a < xc and b < xc, both a and b are less than the critical point.

∫ ( r * x + s dx, x = a to x = b)

= -(r * b^2 ÷ 2 + s * b) - -(r * a^2 ÷ 2 + s * a)

= -(r * b^2 ÷ 2 + s * b) + (r * a^2 ÷ 2 + s * a)

= (-r * b^2 ÷ 2 - s * b) + (r * a^2 ÷ 2 + s * a)

= -f(b) + f(a)

= -(f(b) - f(a))



Combining cases 1 and 2, the area can be calculated as:

area = abs(f(b) – f(a))

with (a – xc) * (b – xc) ≥ 0



Case 3: a < xc and b ≥ xc

∫ ( r * x + s dx, x = a to x = b)

= ∫ ( -(r * x + s) dx, x = a to x = xc) + ∫ ( r * x + s dx, x = xc to b)

= -(r * xc^2 ÷ 2 + s *xc) + (r * a^2 ÷ 2 + s * a) + (r * b^2 ÷ 2 + s * b) – (r * xc^2 ÷ 2 + s * xc)

= -f(xc) + f(a) + f(b) – f(xc)

= f(a) – 2 * f(xc) + f(b)

Since area must be positive: abs(f(a) – 2 * f(xc) + f(b)).

Consequently: (a – xc) * (b – xc) < 0.



In summary:

Let xc = -r/s

If (a – xc) * (b – xc) ≥ 0: area = abs(f(b) – f(a))

Else if (a – xc) * (b – xc) < 0: area = abs(f(a) – 2 * f(xc) + f(b))

where f(x) = r * x^2 ÷ 2 + s * x



Please note: ∫ abs(r * x + s) dx ≠ abs(a * x^2 ÷ b * x)



TI-84 Plus CE Python Edition: abslin1.py



Programmed with TI-84 Plus CE Python, but can be used on any calculator with Python since only the math module is used.



# Math Calculations
from math import *

# Python Version
# 2026-01-05 EWS

print("integral of abs(rx+s)")
r=eval(input("r? "))
s=eval(input("s? "))
a=eval(input("lower limit? "))
b=eval(input("upper limit? "))

# critical point
c=-s/r

# integral
f=lambda x:r*x**2/2+s*x
f0=f(c)
f1=f(a)
f2=f(b)

if (a-c)*(b-c)>=0:
  t=abs(f2-f1)
else:
  t=abs(f1-2*f0+f2)

print("area = ",str(t))



Swiss Micros DM32 Program: asblin



Three labels are used: A (172 bytes), Z (20 bytes), Y (17 bytes), total 209 bytes

Text strings can be eliminated.



A01 LBL A

A02 SF 10

A03 “AREA ABS(RX +S)”

A04 INPUT R

A05 INPUT S

A06 x<>y

A07 ÷

A08 +/-

A09 STO C

A10 XEQ Y

A11 STO D

A12 “LOW=A HIGH=B”

A13 INPUT A

A14 XEQ Y

A15 STO E

A16 INPUT B

A17 XEQ Y

A18 STO F

A19 RCL B

A20 RCL- C

A21 RCL A

A22 RCL- C

A23 ×

A24 x≥0?

A25 GTO Z

A26 RCL E

A27 RCL D

A28 2

A29 ×

A30 -

A31 RCL+ F

A32 ABS

A33 STO Z

A34 CF 10

A35 RTN



Z01 LBL Z

Z02 RCL E

Z03 RCL- F

Z04 ABS

Z05 STO Z

Z06 CF 10

Z07 RTN



Y01 LBL Y (Note: f(x) = r*x^2 ÷ 2 + s*x)

Y02 ENTER

Y03 x^2

Y04 RCL× R

Y05 2

Y06 ÷

Y07 x<>y

Y08 RCL× S

Y09 +

Y10 RTN



Examples



Example 1:

y = abs(4 * x + 3)

r = 4, s = 3, xc = -0.75





Lower Limit (a)

Higher Limit (b)

Area

-4

5

87.25

-4

-1

21

0

5

65



Example 2:

y = abs(-3 * x + 6)

r = -3, s = 6, xc = 2



Lower Limit (a)

Higher Limit (b)

Area

-5

5

87

3

5

12

-5

1

72


Hope you find this helpful and have a great day,


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, February 15, 2026

Casio fx-3650P vs. Casio fx-3650P II: Programs


Here are four programs that are done with both the fx-3650P and fx-3650P II to illustrate some programming similarities and differences.


When we start a new program with the fx-3650P II, we are prompted to the choose the appropriate mode at the beginning:


COMP (main calculation with real numbers)

CMPLX (complex numbers, primarily complex number arithmetic)

SD (single-derivation mode, single-variable statistics)

REG (regression mode, two-variable statistics)

BASE (base conversions and Boolean logic)


Left:  Casio fx-3650P (2002), Right:  fx-3650P II (2013)


Program 1: Exponential Distribution


This program calculates:


PDF: e^(-X ÷ A)

CDF (lower tail): 1 - e^(-X ÷ A)


where:

A = 1/λ parameter (i.e. average waiting time, time for an event to occur/fail/succeed)

X = time parameter


fx-3650P, 25 bytes:


? → A : ? → X :

e(-X ÷ A) ÷ A ◢

1 – e(-X ÷ A)


fx-3650P II, 25 bytes:


? → A : ? → X :

e^(-X ÷ A) ÷ A ◢

1 – e^(-X ÷ A)


Example 1:

Inputs: A = 100, X = 50

Outputs: 6.065306597E-3 (*10^-3), 0.39346934


Example 2:

Inputs: A = 50, X = 3

Outputs: 0.01883529, 0.058235466


Program 2: Using Newton’s Method to get the real root of the cubic equation that is closest to zero:


x^3 + A * x^2 + B * x + C = 0


Using Newton’s Method:


x1 = x0 – f(x0) / f’(x0) [ let y = f(x0) / f’(x0) ]


x1 = x0 - (x^3 + A * x^2 + B * x + C) / (3 * x^2 + 2 * A * x + B)



fx-3650P, 72 bytes:


? → A : ? → B : ? → C : 0 → X :

Lbl 0 :

(X³ + AX² + BX + C) ÷ (3X² + 2AX + B) → Y :

√(Y²) → D :

X – Y → X :

D ≥ 1E-8 ⇒ Goto 0 : X


√(Y²) returns Abs(Y) in Comp mode.

D is set up to be the control variable, where

D = abs((x^3 + A * x^2 + B * x + C) / (3 * x^2 + 2 * A * x + B))



fx-3650PII, 67 bytes:


? → A : ? → B : ? → C : 0 → X : 1 → Y :

While Abs(Y) ≥ 1E-8 :

(X³ + AX² + BX + C) ÷ (3X² + 2AX + B) → Y :

X – Y → X :

WhileEnd: X


We could have used the derivative function (d/dx) but typing out the derivative took less room.


Example 1: X³ + 2X² – 5X + 4 = 0

Inputs: A = 2, B = -5, C = 4

Output: -3.663076827


Example 2: X³ – 3X² + 9X + 6 = 0

Inputs: A = -3, B = 9, C = 6

Output: -0.5481911635



Program 3: Sum of the polynomial: Σ((AX + B)^C, X = 1 to Y)


fx-3650P, 57 bytes:


0 → M : ? → A : ? → B : ? → C : ? → Y : 1 → X :

Lbl 0 :

(AX + B)^C M+ : X + 1 → X : X > Y ⇒ Goto 1 : Goto 0 :

Lbl 1 : M



fx-3650PII, 41 bytes:


0 → M : ? → A : ? → B : ? → C : ? → Y : 1 → X :

For 1 → X To Y : (AX + B)^(C) M+ : Next : M



Example 1: Σ((5X – 3)^2, X = 1 to 8)

Inputs: A = 5, B = -3, C = 2, Y = 8

Output: 4092



Example 2: Σ((2X + 1)^3, X = 1 to 10)

Inputs: A = 2, B = 1, C = 3, Y = 10

Output: 29160


Program 4: Complex Roots of Unity


x^n = 1


where:

x = cos(2 * m * π / n) + i * sin(2 * m * π / n) = r * e^(2 * m * i / n)

m = 0 to n – 1, i = j = √-1


fx-3650P, 47 bytes:


Switch to complex mode. The CMPLX indicator will be displayed but not shown as a step.


Rad : ? → A : 0 → B :

Lbl 0 :

cos(2 B Ï€ ÷ A) + i × sin(2 B Ï€ ÷ A) ◢

1 + B → B : A > B ⇒ Goto 0 : 1


We must have an else condition when the jump command is used, that is why the second one is there. Also, that one “indicates” the end.


fx-3650PII, 34 bytes:


Rad : ? → A :

For 0 → B To A :

cos(2 B Ï€ ÷ A) + i × sin(2 B Ï€ ÷ A) ◢

Next : 1


The second one “indicates” the end and can be omitted.


In complex mode, the real and imaginary parts are displayed on part at a time. A settle R←→I indicator displays at the right hand side of the screen. Switch between seeing the parts by pressing [ SHIFT ] [ EXE ].


Example 1: x^3 = 1

Input: A = 3

Outputs:

1 + 0 i

-0.5 + 0.866025403 i

-0.5 - 0.866025403 i


Example 2: x^5 = 1

Input: A = 5

Outputs:

1 + 0 i

0.309016994 + 0.951056516 i

-0.809016994 + 0.587785252 i

-0.809016994 - 0.587785252 i

0.309016994 - 0.951056516 i


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 4, 2026

Casio fx-CG 100 Python: Infinite Series and Fresnel Integrals

Casio fx-CG 100 Python: Infinite Series and Fresnel Integrals



Introduction



Many functions, such as the Fresnel Integrals, the Zeta function, and the error function, can be calculated using infinite polynomials by the sum:



f(x) = Σ( g(x, n) from n = 0 to n = ∞) or

f(x) = Σ( g(x, n) from n = 1 to n = ∞)



where:

f(x): the function to be calculated

g(x, n): the infinite series representative of (x)



g(x, n) often includes the factorial function n!, where n starts at either 0 or 1 to infinity. While I was programming on fx-CG 100, I did not find a factorial function in the math module that is included in the MicroPython. So I included a definition of the factorial function as:



# factorial function

def fact(n):

  f=1

  if n<=1:

    return 1

  else:

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

      f*=i

  return f



While this function does not check for negative integers, it gives the default values 0! = 1! = 1.


The main program sets up a sum, ask for initial values, and set up a check variable w = g(x,n), with a high initial value to “fail” the loop test. The loop template is set up as:


w=initial value

n=0 (start value of n)

while abs(w)>=1e-20: (1e-20 is a tolerance value, which can be adjusted)

  w=g(x,n)

  s+=w

  n+=1



An Example: Cosine of x Squared



Radians mode is used and is the default angle mode in Python.



cos(x²) = 1 – x^4 ÷ 2 + x^8 ÷ 24 – x^12 ÷ 720 + x^16 ÷ 40320 - …

= Σ( x^(4*n) * (-1)^n ÷ (2n)!, n = 0 to n = ∞)



In this case, g(x,n) = x^(4*n) * (-1)^n ÷ (2 * n)!

I set accuracy tolerance of 1 * 10^-20 but formatted the answer to 12 decimal places.


Casio fx-CG 100 Micropython: cossq.py



# cosine of x squared by series

# template of infinite series

# math module so pi is allowed



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

# setup sum

s=0

# ask for x

print("cos(x**2) by series")

x=eval(input("x radians: "))

# series

# set term artificially high

w=100

# set counter at beginning

n=0

# series loop

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

  w=x**(4*n)*(-1)**(n)/fact(2*n)

  s+=w

  n+=1

# answer

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



Examples:

Example 1: Input: x = 0.5, Result: 0.968912421711

Example 2: Input: x = 1.7, Result: -0.968517164228



Fresnel Integrals



There are two Fresnel integrals.



Cosine Fresnel Integral:

C(x) = ∫( cos( t^2) dt, t = 0 to t = x)

This integral is represented by the infinite series:

C(x) = Σ( x^(4*n + 1) * (-1)^n ÷ ((2* n)! * (4 * n + 1)), n = 0 to n = ∞)



Sine Fresnel Integral:

S(x) = ∫( sin( t^2) dt, t = 0 to t = x)

This integral is represented by the infinite series:

S(x) = Σ( x^(4*n + 3) * (-1)^n ÷ ((2* n + 1)! * (4 * n + 3)), n = 0 to n = ∞)



Casio fx-CG 100 Micropython: fresnel.py



# Fresnel Integrals

# 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

# c: cosine, s=sine

c=0

s=0

# ask for x

x=eval(input("x radians: "))

# series

# set term artificially high

w=100

# set counter at beginning

n=0

# series loop

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

  a=(-1)**n*x**(4*n+1)/(fact(2*n)*(4*n+1))

  b=(-1)**n*x**(4*n+3)/(fact(2*n+1)*(4*n+3))

  w=max(a,b)

  c+=a

  s+=b

  n+=1

# answer

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

print("Fresnel Cosine:\n{0:.12f}".format(c))

print("Fresnel Sine:\n{0:.12f}".format(s))


Examples:

Example 1: x = 0.4,

C(0.4) ≈ 0.398977212913, S(0.4) ≈ 0.021294355570

Example 2: x = 3.1,

C(3.1) ≈ 0.605132097879, S(3.1) ≈ 0.785491219284

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, December 27, 2025

Casio fx-991CW: Second Derivative

Casio fx-991CW: Second Derivative


Calculating Higher Order Derivatives


A general formula to estimate derivatives of order n, where n is a positive integer (see Sources, Wikipedia):


d^n/dx^n = lim h→0 (1÷h^n * Σ((-1)^(k+n) * comb(n,k) * f(x+k*h), k=0, n)


The first, second, and third derivatives are derived from the above formula like so:


n = 1:

d/dx

= lim h→0 (1÷h * Σ((-1)^(k+1) * comb(1,k) * f(x+k*h), k=0 to 1)

= lim h→0 (1÷h * ((-1)^(0+1)*f(x) + (-1)^(1+1)*f(x+h))

= lim h→0 (1÷h * (-f(x) + f(x+h))

= lim h→0 (f(x+h) - f(x)) ÷ h


This is the famous forward difference formula.


n = 2:

d^2/dx^2

= lim h→0 (1÷h^2 * Σ((-1)^(k+2) * comb(2,k) * f(x+k*h), k=0 to 2)

= lim h→0 (1÷h^2 * ((-1)^2*comb(2,0)*f(x) + (-1)^3*comb(2,1)* f(x+h) + (-1)^4*comb(2,2)*f(x+2*h))

= lim h→0 (f(x) - 2*f(x+h) + f(x+2*h)) ÷ h^2


n = 3:

d^3/x^3

= lim h→0 (1÷h^3 * Σ((-1)^(k+3 * comb(3k) * f(x+k*h), k=0 to 3)

= lim h→0 (1÷h^3 * ((-1)^3*comb(3,0)*f(x) + (-1)^4*comb(3,1)*f(x+h) + (-1)^5*comb(3,2)*f(x+2*h)

+ (-1)^6*comb(3,3)*f(x+3*h))

= lim h→0 (-f(x) + 3*f(x+h) - 3*f(x+2*h) + f(x+3*h)) ÷ h^3



Using the fx-991CW


- - - - - - - - - -

Start with a note: Commentary and limitations: The functions f(x) and g(x), along with the calculus functions sum (Σ), integral (∫), and derivative (d/dx), has x as variable. It makes it a challenge that x is the only variable the functions f and g can take.


Example:


f(x)=x^2

g(x)=Σ(f(x),x=0 to 5)


Executing g(x) will take the values x=0 through x=5 no matter what value we put for g. The answer, in this example, will always return 0^2 + 1^2 + 2^2 + 3^2 + 4^2 + 5^2 = 55.

- - - - - - - - - -


We can still use f and g to set up specific derivatives in order n. For the second dervative, set up f and g:


f(x) = <function in terms of x>

g(x) = (f(x+2×A)-2×f(x+A)+f(x))÷A²


Store h in A. We can also choose an h and write in the formula directly.


Remember, this will calculate an approximation. With the most appropriate settings for h, we can get the best approximation.


Examples


For all the examples, A is set as 10^-7. The calculator is set to Radians. g(x) is the second derivative approximation.


Example 1:


f(x) = sin(x), f''(x) = -sin(x)

g(x) = (f(x+2×A)-2×f(x+A)+f(x))÷A²


x = 0.6; g(x): -0.564642551 (actual: -0.5646424734)

x = 2.8; g(x): -0.334988057 (actual: -0.3349881502)


Example 2:


f(x) = 2×e^(0.3×x), f''(x) = 0.18×e^(0.3×x)

g(x) = (f(x+2×A)-2×f(x+A)+f(x))÷A²


x = 0; g(x): 9/50 = 0.18 (actual: 0.18)

x = 1.2; g(x): 0.25799928 (actual: 0.2579992946)


Example 3:


f(x) = 1.1×x^3, f''(x) = 6.6×x

g(x) = (f(x+2×A)-2×f(x+A)+f(x))÷A²


x = 0; g(x): 6.6×10^-7 (actual: 0)

x = 2.2; g(x): 14.52 (actual: 14.52)



Sources



McCarty, George. Calculator Calculus. EduCALC Publications. E. & F.N. Spon: London. 1975, ISBN 0- 419-12910-3



Wikipedia "Numeric differentiation" Wikimedia Foundation, Inc. Last Edited June 17, 2025. Last Accessed July 7, 2025. https://en.wikipedia.org/wiki/Numerical_differentiation


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.



Saturday, December 20, 2025

Basic vs. Python: Helix Curve (with Casio fx-CG 50)

Basic vs. Python: Helix Curve (with Casio fx-CG 50)



Calculators Used: Casio fx-CG100, Casio fx-CG50



The Helix Curve



The helix space curve can be defined with the following set of parametric equations:



x(t) = r × cos(t)

y(t) = r × sin(t)

z(t) = c × t

where r = radius, c = spacing between the coils of the helix



We can use any measurement of length we want, such as meters, feet, or inches, as long as our measurements are consistent.



Graphing the Helix Equation



Regarding calculators, 3D parametric equations can be graphed with the Casio fx-CG 50, fx-CG 100 (independent variables s and t), and the TI-Nspire (independent variables t and u). The screenshots below is a graph of a helix with the use of the fx-CG 100 emulator (classpad.workspace.com):






Curvature, Torsion, and Arc Length of a Helix



For the formulas, let

x = r × cos(t), x’ = -r × sin(t), x’’ = -r × cos(t), x’’’ = r × sin(t)

y = r × sin(t), y’ = r × cos(t), y’’ = -r × sin(t), y’’’ = -r × cos(t)

z = c × t, z’ = c, z’’ = 0, z’’’ = 0



The variable t is the independent variable of x(t), y(t), and z(t).



Curvature



The general formula for curvature:

k² = ((x’² + y’² + z’²) × (x’’² + y’’² + z’’²) – (x’ × x’’ + y’ × y’’ + z’ × z’’)) ÷ (x’² + y’² + z’²)³



Applying to the helix:

k² = ((r² sin² t + r² cos² t + c²) × (r² cos² t + r² sin² t + 0) – (r² sin t cos t – r² sin t cos t + 0)) ÷ (r² sin² t + r² cos² t + c²)³

Note: r² sin² t + r² cos² t = r² × (sin² t + cos² t) = r²

k² = ((r² + c²) × r²) ÷ (r² + c²)³

k² = r² ÷ (r² + c²)²

k = r ÷ (r² + c²)

Note: curvature is assumed to be a positive value





Torsion



The general formula for torsion:

Ï„ =

(x’’’ × (y’ × z’’ – y’’ × z’) + y’’’ × (x’’’ × z’ – x’ × z’’’) + z’’’ × (x’ × y’’ – x’’ × y’))

÷ ((y’ × z’’ – y’’ × z’)² + (x’’ × z’ – x’ × z’’)² + (x’ × y’’ – x’’ × y’)²)



Breaking it down into parts:



x’’’ × (y’ × z’’ – y’’ × z’) = r × sin t × (0 - -r × sin t × c) = r² × c × sin² t

y’’’ × (x’’’ × z’ – x’ × z’’’) = -r × cos t × (-r × cos t × c – 0) = r² × c × cos² t

z’’’ × (x’ × y’’ – x’’ × y’) = 0

x’’’ × (y’ × z’’ – y’’ × z’) + y’’’ × (x’’’ × z’ – x’ × z’’’) + z’’’ × (x’ × y’’ – x’’ × y’)

= r² × c × sin² t + r² × c × cos² t + 0 = r² × c



(y’ × z’’ – y’’ × z’)² = (0 - -r × sin t × c)² = r² × c² × sin² t

(x’’ × z’ – x’ × z’’)² = (-r × cos t × c – 0)² = r² × c² × cos² t

(x’ × y’’ – x’’ × y’)² = (r² sin² t + r² cos² t)² = r^4

(y’ × z’’ – y’’ × z’)² + (x’’ × z’ – x’ × z’’)² + (x’ × y’’ – x’’ × y’)²

= r² × c² × sin² t + r² × c² × cos² t + r^4 = r² × c² + r^4 = r² × (c² + r²)



Then:

Ï„ = (r² × c) ÷ (r² × (c² + r²)) = c ÷ (r² + c²)





Arc Tangent from t = 0 to t = x



s = ∫ √(x’² + y’² + z’²) dt from t = 0 to t = x



Since:

x’² + y’² + z’² = r² sin² t + r² cos² t + c² = r² + c²



Then:

s = ∫ √(x’² + y’² + z’²) dt from t = 0 to t = x

= ∫ √(r² + c²) dt from t = 0 to t = x

= x × √(r² + c²)



To summarize, for the helix curve:

Curvature: k = r ÷ (r² + c²)

Torsion: Ï„ = c ÷ (r² + c²)

Arc Length to x: s = x × √(r² + c²)



The code below calculates the following:

* curvature

* torsion

* arc length to 2Ï€



Casio fx-CG50 Program HELIXFX



"HELIX: CASIO BASIC"

"RADIUS"?→R

"SPACING"?→c

"CURVATURE="

R÷(R²+C²)→K ◢

"TORISON="

C÷(R²+C²)→T ◢

"ARC LENGTH TO 2Ï€="

2×Ï€×√(R²+C²)→S



Python Script: helixp.py



from math import *

print("Helix: Parameters")

print("math module imported\n")

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

c=eval(input("spacing? "))

k=r/(r**2+c**2)

t=c/(r**2+c**2)

print("curvature=\n",str(k))

print("torsion=\n",str(t))

print("arc length to 2pi=\n",str(s))



Example



Radius: r = 2.75

Spacing: c = 0.89



Outputs:

Curvature: 0.3291599837

Torsion: 0.1065281402

Arc length to 2Ï€: 18.16112298



Sources



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

Lee, Sarah. “Curvature and Torsion of 3D Parametric Curves.” Number Analytics // Super Easy Data Analysis Tool for Research, May 17, 2015, www.numberanalytics.com/blog/curvature-torsion-3d-parametric-curves . Accessed 02 July 2025.

Weisstein, Eric W. "Helix." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/Helix.html Accessed July 2, 2025.

Wikimedia Foundation. “Torsion of a curve.” Wikipedia. Lasted Edited January 2, 2023, https://en.wikipedia.org/wiki/Torsion_of_a_curve Accessed July 2, 2025.


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