Showing posts with label graphics. Show all posts
Showing posts with label graphics. Show all posts

Saturday, October 24, 2026

Python: Drawing a Ring of Circles

Python: Drawing a Ring of Circles


The goal: Draw a number of circles that revolve around the origin (0,0). The center of each circle is rotated counterclockwise. The angle of the rotation is determined by:


a = 360° ÷ n = (2 * π rad) ÷ n


Since the center of each circle is set at (0, 0), the center of each circle is located at (r * cos a, r * sin a) where r is the radius.



Python: Using Turtle (Numworks)




( radius = 50 pixels, n = 8 circles)



The script circring.py imports the Turtle module. The circle command draws a circle starting at the bottom of the circle going counter-clockwise. The bottom of the circle is located at the point (x, y – r) where (x, y) is the center and r is the radius.


Code:


from math import *

from turtle import *


# 2026-07-19 EWS

# turtle version


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

n=int(input("# steps? "))


speed(7)


for i in range(n):

  # set angle

  a=i*2*pi/n

  # turtle circle starts at

  # bottom center point

  x=r*cos(a)

  y=r*(sin(a)-1)

  # move to starting point

  penup()

  goto(x,y)

  # draw circle

  pendown()

  circle(r)

  

# make turtle invisible

hideturtle()



Python: Using TI-Draw (TI-84 Evo)



( radius = 50 pixels, n = 8 circles)


The script CIRRNG84.py uses the TI Draw module. The TI-84 Evo (and I think the TI nSpire, not 100% sure) lacks the Turtle module and instead employs a calculator-specific drawing module. The draw_circle command calls for both the center point and the radius. No adjustments are necessary.


Code:

from ti_draw import *

from math import *


# 2026-07-19 EWS

# TI version non turtle


set_window(-160,160,-105,105)

print("grid -160,160,-105,105")

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

n=int(input("# steps? "))

clear()


for i in range(n):

  # set angle

  a=i*2*pi/n

  # determine center

  x=r*cos(a)

  y=r*sin(a)

  # draw circle

  draw_circle(x,y,r)


# show picture

show_draw()


Source



Chartier, Tim and Langville, Amy. Nonstandard Notebook: Mathematically Rule Pages for Unruly Thoughts The University of Chicago Press: Chicago and London. 2024 ISBN-13 978-0-226-83090-2 <pg. 61-63>



If you get a chance, please get this book. It’s a journal of interesting curves involving polynomials, circles, lines, and waves. The authors uses these curves to illustrate what ruled paper would look like when it doesn’t consist of all straight lines. The concept of music, earthquakes, and heartbeats are illustrated, including equations for clovers, mandalas, and hearts. This book is an inspiration for me.


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, September 19, 2026

Sharp EL-5200/EL-9000 AER II Program Collection – September 2026

Sharp EL-5200/EL-9000 AER II Program Collection – September 2026



For my review on the Sharp EL-5200 (also known as the Sharp EL-9000), check out this blog entry from 2024: https://edspi31415.blogspot.com/2024/04/spotlight-sharp-el-5200.html


The AER programming on Sharp is very unusual.


* Angle mode has to be set manually through the [ 2ndF ] [ FSE ] (DRG) key sequence.

* Similarly, the decimal settings have be set manually through the [ 2ndF ] [ FSE ] key sequence and setting number of decimal places through tab.

* In AER II, there are really only two ways to display messages. First, through the program title when cycling through the programs with the [ PRO ] key. Second by setting a result variable such as area=2×π×r². The display will show “area= (next line) result”.


Graphing Commands


Setting the graphing range:

RANGE xmin, xmax, xstep, ymin, ymax, ystep


Clearing the graph:

G.CL ([2ndF] [ ← ])


Plotting a point:

PLOT x, y

This may include expressions, the point must be in the graph area or an Error 2 occurs.


Drawing a line:

LINE x1, y1, x2, y2

The entire line must fine the graph area or an Error 2 occurs.


Plotting a function:

GRAPH f(X)


Auto Sizing the window (Y-range only):

AUTO

Placed before the DRAW command.


Draw and show the graph screen:

DRAW


Finally, how are loops done?

* Loops are only available on the main portion of the program, and not in the subroutines. I found this out the hard way.

* Use the Y (Yes) and N (No) results to enable the loop.

* There are only four comparisons: =, >, >=, and ≠


A sample syntax:


↳ (loop commands) (comparison) – Y ⇒ [ do if true ↰ ]

↳ (loop commands) (comparison) – N ⇒ [ do if false ↰ ]



All programs today are in AER II mode. Spaces are provided for readability.


Sharp EL-5200: Random Integers


Title: random integers

M: low=? high=? num=?

↳ num>0 -Y→[ INT (RND ×(high-low))+low,

num=num-1 ↰]


Keep on pressing [COMP] until a zero comes up, which signals the end of the list. (This assumes that low and high are both positive numbers.)


Example:


low=15, high=95, num=5

ans=41, 64, 78, 69, 17, 0





Sharp EL-5200: Work Sample Size, 95% Confidence



size = z² ÷ (%acc ÷ 100)² × (1 - #occ ÷ #obs) ÷ #obs × #occ

z: normal distribution value that indicates confidence level; for a 95% interval, z ≈ 1.9599

%acc: desired percent accuracy

#occ: number of occurrences (i.e. idle employees, targets not met, hours missed, etc.) in the preliminary sample

#obs: number of observances in the preliminary sample


Title: work sample size, with 95 percent confidence

M: size = 1.9599² ÷ (occ ÷ 100)² × (1 – occ ÷ obs) ÷ occ × obs ␣

size = INT size + 1,

rat = occ ÷ obs



The size is rounded up to the nearest integer.

rat: ratio of occurrences to observances



Examples:



Example 1:

acc: 10%, occ: 3, obs: 20.

Result: size: 2177, ratio: 0.15



Example 2:

acc: 5%, occ: 2, obs: 108

Result: size: 81,434, ratio: 0.018518519



Source:

Hewlett Packard. “Business Finance and Accounting: Step-by-Step Solutions for Your HP-17B, HP-19B, or HP-27S Calculator”. HP Part No. 00017-90020. Printed in Canada. Edition 3. Corvallis, OR. September 1991. pp. 97-98



Sharp EL-5200: Eigenvalue of a 2 x 2 Matrix



This calculates the eigenvalues of a 2 x 2 matrix, [ [ a, b ] [ c, d ] ] by the following sequence:



m = (a + d) ÷ 2

p = a * d – b * c

Eigenvalues

λ = m ± √(m² – p)



Title: eigen of [[a,b][c,d]] (real)

M: a=? b=? c=? d=?

m=(a+d)÷2 ␣

p=a×d-b×c ␣

m+√(m²-p),

m-√(m²-p)



Example:

[ [10, 8], [3, 6] ]

a=10, b=8, c=3, d=6

Result: 13.29150262, 2.708497378



Source:

3Blue1Brown. “A quick trick for computing eigenvalues | Chapter 15, Essence of linear algebra” YouTube video, posted May 7, 2021. https://www.youtube.com/watch?v=e50Bj7jn9IQ



The next three programs deal with graphics.



Sharp EL-5200: Graphing a Sine Wave



Graph of y = A × sin(B × x + C) given A, B, C. Angles are set to be in radians.



Title: graph A×sin(Bx+C). Set radians mode.

M: A=? B=? C=?

GRAPH A×SIN (B×X+C) AUTO DRAW



Sharp EL-5200: Graphing a Line



Draw a line between (a,b) and (c,d). The program determines the window by determining the maximum and minimum for two numbers:



max(x,y) = (x + y + abs(x – y)) ÷ 2

min(x,y) = (x + y – abs(x – y)) ÷ 2



The distance is displayed.



Title: draw a line between (a,b) and (c,d)

M: a=? b=? c=? d-?

dist=√((c-a)² + (d-b)²),

max=(a+c+ABS(a-c))÷2 ␣

mix=(a+c-ABS(a-c))÷2 ␣

may=(b+d+ABS(b-d))÷2 ␣

miy=(b+d-ABS(b-d))÷2 ␣

RANGE mix-1, max+1, 1, miy-1, may+1, 1 ␣

LINE a, b, c, d DRAW



Sharp EL-5200: Graphing a Rose



This program graphs the rose:

r = cos(5 * Θ) for 0 ≤ Θ ≤ π







Title: graph a rose, set rad mode

M: G.CL ␣ a=0 ␣

RANGE -1.2, 1.2, 0.2, -1.2, 1.2, 0.2 ␣

↳PLOT COS(5×a)×COS a, COS(5×a)×SIN a

DRAW a=a+π÷128 ␣

a>π – N → [ ↰ ]



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, March 21, 2026

TI-83 Premium CE Edition Python and Casio fx-92 Collège: Graphing Roses

TI-83 Premium CE Edition Python and Casio fx-92 Collège: Graphing Roses


Introduction


The scripts presented today will draw a rose with the following polar equation:


r = a * cos(n * Θ)


If n is odd, then the rose will have n petals, but if n is even, then the rose will have double the petals (2*n petals).



TI-83 Premium CE Edition Python (and TI-84 Plus CE Python): ROSE84.PY


from math import *

from turtle import *

t=Turtle()

t.clear()

t.hidegrid()

t.hideturtle()

t.pencolor(255,0,0)


# set pedal length

a=100

t.penup()

t.goto(a,0)


# ask for pedals

print(“** rose **”)

print(“odd n: n pedals”)

print(“even n: 2*n pedals”)

n=eval(input(“n? “))

t.clear()


# draw

t.pendown()

for i in range(129):

  # theta

  m=i/128*2*pi

  # r

  r=a*cos(n*m)

  t.goto(r*cos(m),r*sin(m))

t.done()






Casio fx-92 Collège: Graphing a Rose


Note: The instructions are in French.


INSTRUCTION

DETAIL

ENGLISH TRANSLATION

Style Criox


Cross Cursor Style

? → B

Demander valuer B

Input B

20 → A

Metrire var á 20 → A

Set A = 20

Aller á x = A; y = 0


Goto (A, 0)

Stylo écrit


Pen down

Répéter 128


Repeat 128 times (loop):

C ÷ 128 × 2 × π → D

Metrire var á C ÷ 128 × 2 × π → D

Set D = C/128*2*π

A × cos((B × D)^r) → E

Metrire var á A × cos((B × D)^r) → E

Set E = A*(cos(B*D)), B*D is in radians.

Aller à x=E×cos(D^r); y=E×sin(D^r)


Goto (E * cos D, E * sin D). D is in radians.

C + 1 → C

Metrire var á C + 1 → C

Set C = C + 1

↑


End of loop


Note: To designate a measure of an angle to be radians regardless of calculator setting, press [ CATALOG ] >> Angl/Coord/Sexag >> Radians.






Drawing roses on the first day of spring,



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

TI-84 Plus CE Python: Traceable Plots in Python

TI-84 Plus CE Python: Traceable Plots in Python


These two scripts are an easy way on how to create plots that are traceable. A traceable plot allows the user to trace along a scatter plot or functional plot by using the right and left arrow keys, just like if you made a plot in a graphing calculators’ graph mode.



The two scripts presented are:



TIRNDPLT: makes a scatter plot of ten random points between 0 and 1. The x axis is the plot marker while the y axis is the random point.

TIFXPLT: makes a plot of a single function y(x). Radians mode as assumed and the plot is made of 50 points. You specify the minimum and maximum values of x. Radians mode is assumed and the math module has imported, allowing for scientific functions. A caveat is to plot a function where it is defined for all of the domain given. For instance, for sqrt(x), no negative values should be included in the domain [xmin, xmax].



The two scripts can be downloaded here:

https://drive.google.com/file/d/1D3oB7Vrt9cd1e-wXrEkhZbr8VJ_7V4qB/view?usp=sharing



However I am going to list the code because there are things to be pointed out.



TIRNDPLT



Code:

# TI-84+: Traceable Plot

# Edward Shore 2026-02-20
# tirndplt.py

# Plot ten random elements

# import modules
from math import *
from random import *
from ti_system import *
# plot module is imported differently
import ti_plotlib as plt


# build a random list
x=[i for i in range(1,11)]
y=[round(random(),4) for i in range(1,11)]

# set up the key
# left (2) and right (1) is the trace, enter to exit (5)
k=0

# set the pointer
p=0

# constant elements
# clear the screen
plt.cls()
# set window to allow room for text
plt.window(0,11,-0.5,1.5)
plt.axes("axes")

# plot gray grid
plt.color(192,192,192)
plt.grid(1,0.1)

# main loop, faster?, redraw only replaceable elements
while k!=5:
  # scatter plot, filled dot default
  plt.color(0,0,0)
  plt.scatter(x,y)
  # text at line 1
  plt.text_at(1,"<-, ->, press enter to exit","left",1)
  # string at line 12
  s="x = {0:.0f}, y = {1:.4f}".format(x[p],y[p])
  plt.text_at(12,s,"left",1)
  # plot pointer with cross, blue
  plt.color(0,0,255)
  plt.plot(x[p],y[p],"x")
  # get key
  k=wait_key()
  # left and right keys
  if k==2:
    # clear
    plt.color(255,255,255)
    plt.plot(x[p],y[p],"x")
    # replace
    plt.color(0,0,0)
    plt.plot(x[p],y[p])
    p=(p-1)%10
  elif k==1:
    plt.color(255,255,255)
    plt.plot(x[p],y[p],"x")
    plt.color(0,0,0)
    plt.plot(x[p],y[p])
    p=(p+1)%10

# show draw at the end
plt.text_at(1,"DONE","left",1)
plt.show_plot()


Notes:


1. Modules used: math, random, ti_system, and ti_plotlib. The calling of math and random modules allow the user to include math and random functions. The ti_system has the command wait_key(), which calls for the user to press a key, and returns a specific code value when a key is pressed. The module ti_plotlib is for the specific graphics commands.

2. The y minimum and maximum values for the plot have a padding of 2 to allow room for the top and bottom lines which will contain information. The top line will give instructions for the keys: ← to trace left, → to trace right, and pressing the [ enter ] exits the program.

3. The script has plots in two sections. Outside the loop are elements that will stay permanent: the window, the axis, and the scatter plot. Inside the loop will be the pointer because it changes.

4. Every time an arrow key is processed, the pointer first must be “erased” off the previous position, then move to the next. The pointer is in blue. The variable p is used for the pointer and will take the value between 0 and 9.

5. In Python, the percent symbol is used as a modulus function. So, the expression (p-1)%10 means (p – 1) mod 10. Similarly, (p+1)%10 means (p + 1) mod 10. This is what keeps p in the range of [0, 9]. p is an integer.

6. The use of the format is required to make reading the coordinates readable.

7. Any script using ti_plotlib must have a plt.show_plot() command, at least at the end. It’s primary purpose is to show the final picture and freeze the screen in graphics mode.


TIFXPLT.py




Code:

# TI-84+: Traceable Plot
# Edward Shore 2026-02-22
# tifxplt.py


# Plot a traceable function

# import modules
from math import *
from random import *
from ti_system import *
# plot module is imported differently
import ti_plotlib as plt

# build f(x)
fx=input("y(x)? ")
xmin=eval(input("xmin? "))
xmax=eval(input("xmax? "))
chgx=(xmax-xmin)/50

xl=[]
yl=[]

x=xmin
while x<=xmax:
  y=eval(fx)
  xl.append(x)
  yl.append(y)
  x+=chgx

ymin=min(yl)-2
ymax=max(yl)+2

# set up the key
# left (2) and right (1) is the trace, enter to exit (5)
k=0

# set the pointer
p=0

# constant elements
# clear the screen
plt.cls()
# set window to allow room for text
plt.window(xmin,xmax,ymin,ymax)
plt.color(16,16,16)
plt.axes("on")

plt.color(0,0,0)
plt.plot(xl,yl,".")

# main loop, faster?, redraw only replaceable elements
while k!=5:
  # scatter plot, filled dot default
  # text at line 1
  plt.text_at(1,"<-, ->, press enter to exit","left",1)
  # string at line 12
  s="x = {0:.1f}, y = {1:.4f}".format(xl[p],yl[p])
  plt.text_at(12,s,"left",1)
  # plot pointer with cross, blue
  plt.color(0,0,255)
  plt.plot(xl[p],yl[p],"x")
  # get key
  k=wait_key()
  # left and right keys
  if k==2:
    # clear
    plt.color(255,255,255)
    plt.plot(xl[p],yl[p],"x")
    # replace
    plt.color(0,0,0)
    plt.plot(xl[p],yl[p])
    p=(p-1)%50
  elif k==1:
    plt.color(255,255,255)
    plt.plot(xl[p],yl[p],"x")
    plt.color(0,0,0)
    plt.plot(xl[p],yl[p])
    p=(p+1)%50

# show draw at the end
plt.text_at(1,"DONE","left",1)
plt.show_plot()



Notes:

1. Modules used: math, random, ti_system, and ti_plotlib. The calling of math and random modules allow the user to include math and random functions. The ti_system has the command wait_key(), which calls for the user to press a key, and returns a specific code value when a key is pressed. The module ti_plotlib is for the specific graphics commands.

2. The y minimum and maximum values for the plot have a padding of 2 to allow room for the top and bottom lines which will contain information. The top line will give instructions for the keys: ← to trace left, → to trace right, and pressing the [ enter ] exits the program.

3. The script has plots in two sections. Outside the loop are elements that will stay permanent: the window, the axis, and the plot of the function. Inside the loop will be the pointer because it changes.

4. Every time an arrow key is processed, the pointer first must be “erased” off the previous position, then move to the next. The pointer is in blue. The variable p is used for the pointer and will take the value between 0 and 49.

5. In Python, the percent symbol is used as a modulus function. So, the expression (p-1)%50 means (p – 1) mod 50. Similarly, (p+1)%50 means (p + 1) mod 50. This is what keeps p in the range of [0, 49]. p is an integer.

6. The use of the format is required to make reading the coordinates readable.

7. Any script using ti_plotlib must have a plt.show_plot() command, at least at the end. It’s primary purpose is to show the final picture and freeze the screen in graphics mode.



I hope you enjoy these programs as I did making them,



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

TI-84 Plus CE: Logistic Map

TI-84 Plus CE: Logistic Map


It feels like forever since I with the TI-84 Plus CE.


Introduction


The program LOGISTIC plots the sequence


x = r * x * (1 – x)


where x is initially in the interval (0, 1) and r is a parameter. The sequence traces out the path of recursion.


Depending on the value of r, the sequence can eventually stabilize to a single point, fluctuate then stabilize, eventually bounce between two stable points, or going into the chaos. The higher the r, chance of the latter two possibilities increase. Typically, for any r < 3, the sequence will most likely stabilize.



TI-84 Plus CE Program: LOGISTIC.8xp


Type: TI-Basic Program


ClrHome

Disp “LOGISTIC MAP”

Disp “X1=R*X0*(1-X0)”

Seq

FnOff

Menu(“LAMBDA (R)”, “ENTER”, 1, “RANDOM”, 2)

Lbl 1

Input “0<R≤4: “, R

Goto A

Lbl 2

randInt(1,80) / 20 → R

Pause R

Goto A

Lbl A

Menu(“U(1)=”, ”ENTER”, 3, “RANDOM”, 4)

Lbl 3

Input “U(1)? “, U

Goto B

Lbl 4

rand → U

Pause U

Goto B

Lbl B

{U} → u(nMin)

SEQ(n+1)

“R*u(n)*(1-u(n))” → u

FnOn 1

1 → nMin

50 → nMax

0 → Ymin

1 → Ymax

0 → Xmin

50 → Xmax

DispGraph



Notes:


The Time setting is assumed: x-axis = n, y-axis = u__n


nMin: Sets the counter and the index of the first argument. Typically the counter starts with 0 or 1. Keystrokes: [ vars ], 1. Window, scroll to U/V/W, 4. nMin.


Seq: Sets Sequence mode.


I use R for λ since the TI-84 does not have Greek characters (except for π and σ).


randInt(1,80) / 20 → R: Selects random values from 0.05 and 4 with a tick mark of 0.05.


u(nMin): Store the initial conditions. The conditions are entered as a list, even there is only one initial condition. Keystrokes: [ vars ], 1. Window, scroll to U/V/W, 1. u(nMin)


SEQ(n+1): In the program editor, I had to select this from the catalog. It is listed under “SEQ(n+1) Type”. This allows for the recurring sequence to be in the format u(n+1) = f(u(n),n).

“R*u(n)*(1-u(n))” → u: The u is type from the keyboard: [ 2nd ] [ 7 ].

FnOn 1: Turns the sequence u(n) on.



Examples




Left: r = 3.67, initial point = 0.2. This looks like total chaos as n grows.


Right: r = 3.1, initial point = 0.5. This sequence does not converge to a single value, but eventually provides a bifurcation between two points.


Caution: If r is too high, even if the u(1) is with in the interval [0, 1], the sequence can “escape” and an overflow can occur. I don’t recommend an r higher than 4.


Source


“Logistic map”. Wikipedia https://en.wikipedia.org/wiki/Logistic_map Retrieved October 20, 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.

Saturday, August 23, 2025

Casio fx-92 Collège: Plotting Lines, Regular Polygons, and Functions

Casio fx-92 Collège: Plotting Lines, Regular Polygons, and Functions


Introduction


The Casio fx-92 Collège has an algorithm application which is similar to Scratch. For more details, please refer to the Alogirthmique Mode section of my spotlight review:


https://edspi31415.blogspot.com/2025/02/spotlight-casio-fx-92-college.html


A limitation of the fx-92 Collège is that programs are not retained once we leave the Algorithmique Mode or turn the calculator off.


Remember that the commands, the mathematical functions, and keys on the calculator fx-92 Collège are in French. The left column is what will see on the calculator screen** (in French) and the right column is a “rough” translation to English. Please note that I am currently not fluent in French.


** Demander valuer is just shown as ? → var. (Prompt for a value)

** Metire var á is shown as expression → var. (Store an expression to a variable)


Draw a line y = Ax + B.


French: fx-92 Collegè

English Translation

(Demander valeur) ? → A

? → A

(Demander valeur) ? → B

? → B

(Metire var á) (-24 – B) ÷ A →C

(-24 – B) ÷ A →C

(Metire var á) (24 – B) ÷ A →D

(24 – B) ÷ A →D

Si C ≥ D Alors

If C ≥ D Then

(Metire var á) C →E

C →E

(Metire var á) D →C

D →C

(Metire var á) E →D

E →D

Fin

End

Stylo relevè

Pen is raised

Aller à x = C ; y = A×C + B

Go to C, A × C + B

S’ orienter à tan^-1(A) degrès

Set orientation to arctan(A) degrees

Stylo écrit

Pen is down

Avancer de √((D-C)^2 + 48^2) pixels

Move forward √((D-C)^2 + 48^2) pixels

The algorithm draws a line when -24 ≤ y ≤ 24. If x is in the range -96 ≤ x ≤ 95, the line will be plotted on the screen.


The algorithm solves the following equations:


A x + B = -24

A x + B = 24


where the minimum of the two results are stored in C and the maximum of the two results are stored in D.


The equation is given in standard form where A is the slope and B is the y-intercept. If we go to the left side of the line (Xmin) and head to the right, we can draw the line in the direction of the slope, which is calculated by arctan(A). The arc-tangent function typical has a range between -180° to 180° (-π radians to π radians).



Draw a Regular Polygon


Draw a regular polygon of B sides. The radius is fixed at 20 pixels. The polygon is drawn in the middle of the screen.


French: fx-92 Collegè

English Translation

(Demander valeur) ? → B

? → B

(Metire var á) 40 × sin(180° ÷ B) → C

40 × sin(180° ÷ B) → C

Stylo relevè

Pen raised

Aller à x = -C ÷ 2; y = -20

Go to -C ÷ 2, -20

(Metire var á) 1 → A

1 → A

Stylo écrit

Pen is down

Répéter jusqú a A>B

Repeat until A > B

Avancer de C pixels

Move forward C pixels

Tourner de ⟲ 360° ÷ B degrès

Turn (360° ÷ B) degrees

(Metire var á) 1 + A → A

1 + A → A

↑

End repeat loop



The program begins by determining the required side length and positioning the cursor to the point (-C/2, -20). This allows the polygon to drawn in the middle of the screen.



The relationship between the radius of regular polygon (r) and the side length (s) is:


s = 2 * r * sin(180° / n) = 2 * r * sin(π radians/n)


With r = 20, s = 40 * sin(180° / n)


The degree symbol is found in the Catalog → Angl/Coord/Sexag → Degrés.


The variable B is used for the number of sides.




Draw the Function C = f(z).


A = z minimum (Xmin), B = z maximum (Xmax)


Be aware that the plotting screen is limited and there is no ability to zoom. (-96 ≤ z ≤ 95)


The fx-92 errors if C < -999 or C > 999.


French: fx-92 Collegè

English Translation

(Demander valeur) ? → A

? → A

(Demander valeur) ? → B

? → B

(Metire var á) A→ z

A → z

Répéter jusqú a z >B

Repeat until z > B

(Metire var á) f(z)→ C (**)

f(z)→ C (**)

Si z = A Alors

If z = A Then (we are at the xmin at the graph)

Stylo relevè

Pen Raised

Sinon

Then

Stylo écrit

Pen is Down

Fin

End (If)

Aller à x = z ; y = C

Go to z ; C

(Metire var á) z + 0,5→ z

z + 0.5→ z

↑

End repeat loop


Here is where you enter you function. Examples may include:


15 × cos((z ÷ 10)^r ) (^r: Catalog → Angl/Coord/Sexag → Radians)


√z


Abs(z – 3) (Catalog → Cacul Numèrique → Value Absolue)


-2 × z + 1.1


e^(-z) (Catalog → Autre → select e)



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.


Python: Drawing a Ring of Circles

Python: Drawing a Ring of Circles The goal: Draw a number of circles that revolve around the origin (0,0). The center of each circle i...