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.



