Skip to content

Commit 663de78

Browse files
committed
pyl
1 parent df19aab commit 663de78

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

examples/uplot_lissajous_curves.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@
88
from circuitpython_uplot.uplot import Uplot, color
99
from circuitpython_uplot.ucartesian import ucartesian
1010

11-
# Inspired by Paul McWhorter Raspberry Pi Pico W LESSON 27: Creating Lissajous Patterns on an OLED Display
11+
# Inspired by Paul McWhorter Raspberry Pi Pico W LESSON 27: Creating Lissajous Patterns
12+
# on an OLED Display
1213
# And
1314
# https://storm-coder-dojo.github.io/activities/python/curves.html
1415

1516

16-
def create_curve(a=1, b=2, factor=10, delta=3.14 / 2):
17+
def create_curve(a=1, b=2, mul_factor=10, delta=3.14 / 2):
1718
"""
1819
Creates a curve based on the formula
1920
adapted from https://github.com/JPBotelho/Lissajous-Curve
@@ -24,8 +25,8 @@ def create_curve(a=1, b=2, factor=10, delta=3.14 / 2):
2425
yvalues = []
2526
for i in range(0, 315):
2627
t = i * 0.02
27-
x = factor * math.cos(t * a + delta)
28-
y = factor * math.sin(t * b)
28+
x = mul_factor * math.cos(t * a + delta)
29+
y = mul_factor * math.sin(t * b)
2930
xvalues.append(x)
3031
yvalues.append(y)
3132
if abs(x - xvalues[0]) + abs(y - yvalues[0]) < 0.01 and i > 1:

0 commit comments

Comments
 (0)