Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def draw():
global t
width = P5.width
height = P5.height
P5.background(10, 10)
xAngle = P5.map(P5.mouseX, 0, P5.width, -4 * P5.PI, 4 * P5.PI, True)
yAngle = P5.map(P5.mouseY, 0, P5.height, -4 * P5.PI, 4 * P5.PI, True)
for x in range(0, width, 30):
for y in range(0, height, 30):
angle = xAngle * (x / width) + yAngle * (y / height)
myX = x + 20 * P5.cos(2 * P5.PI * t + angle)
myY = y + 20 * P5.sin(2 * P5.PI * t + angle)
P5.ellipse(myX, myY, 10)
t = t + 0.01
console.log(P5.frameRate())
def draw():
global t
width = P5.width
height = P5.height
P5.background(10, 10)
xAngle = P5.map(P5.mouseX, 0, P5.width, -4 * P5.PI, 4 * P5.PI, True)
yAngle = P5.map(P5.mouseY, 0, P5.height, -4 * P5.PI, 4 * P5.PI, True)
for x in range(0, width, 30):
for y in range(0, height, 30):
angle = xAngle * (x / width) + yAngle * (y / height)
myX = x + 20 * P5.cos(2 * P5.PI * t + angle)
myY = y + 20 * P5.sin(2 * P5.PI * t + angle)
P5.ellipse(myX, myY, 10)
t = t + 0.01
console.log(P5.frameRate())
xAngle = P5.map(P5.mouseX, 0, P5.width, -4 * P5.PI, 4 * P5.PI, True)
yAngle = P5.map(P5.mouseY, 0, P5.height, -4 * P5.PI, 4 * P5.PI, True)
for x in range(0, width, 30):
for y in range(0, height, 30):
angle = xAngle * (x / width) + yAngle * (y / height)
myX = x + 20 * P5.cos(2 * P5.PI * t + angle)
myY = y + 20 * P5.sin(2 * P5.PI * t + angle)
P5.ellipse(myX, myY, 10)
t = t + 0.01
console.log(P5.frameRate())
def draw():
global t
width = P5.width
height = P5.height
P5.background(10, 10)
xAngle = P5.map(P5.mouseX, 0, P5.width, -4 * P5.PI, 4 * P5.PI, True)
yAngle = P5.map(P5.mouseY, 0, P5.height, -4 * P5.PI, 4 * P5.PI, True)
for x in range(0, width, 30):
for y in range(0, height, 30):
angle = xAngle * (x / width) + yAngle * (y / height)
myX = x + 20 * P5.cos(2 * P5.PI * t + angle)
myY = y + 20 * P5.sin(2 * P5.PI * t + angle)
P5.ellipse(myX, myY, 10)
t = t + 0.01
console.log(P5.frameRate())
def draw():
global t
width = P5.width
height = P5.height
P5.background(10, 10)
xAngle = P5.map(P5.mouseX, 0, P5.width, -4 * P5.PI, 4 * P5.PI, True)
yAngle = P5.map(P5.mouseY, 0, P5.height, -4 * P5.PI, 4 * P5.PI, True)
for x in range(0, width, 30):
for y in range(0, height, 30):
angle = xAngle * (x / width) + yAngle * (y / height)
myX = x + 20 * P5.cos(2 * P5.PI * t + angle)
myY = y + 20 * P5.sin(2 * P5.PI * t + angle)
P5.ellipse(myX, myY, 10)
t = t + 0.01
console.log(P5.frameRate())
width = P5.width
height = P5.height
P5.background(10, 10)
xAngle = P5.map(P5.mouseX, 0, P5.width, -4 * P5.PI, 4 * P5.PI, True)
yAngle = P5.map(P5.mouseY, 0, P5.height, -4 * P5.PI, 4 * P5.PI, True)
for x in range(0, width, 30):
for y in range(0, height, 30):
angle = xAngle * (x / width) + yAngle * (y / height)
myX = x + 20 * P5.cos(2 * P5.PI * t + angle)
myY = y + 20 * P5.sin(2 * P5.PI * t + angle)
P5.ellipse(myX, myY, 10)
t = t + 0.01
console.log(P5.frameRate())
def draw():
global t
width = P5.width
height = P5.height
P5.background(10, 10)
xAngle = P5.map(P5.mouseX, 0, P5.width, -4 * P5.PI, 4 * P5.PI, True)
yAngle = P5.map(P5.mouseY, 0, P5.height, -4 * P5.PI, 4 * P5.PI, True)
for x in range(0, width, 30):
for y in range(0, height, 30):
angle = xAngle * (x / width) + yAngle * (y / height)
myX = x + 20 * P5.cos(2 * P5.PI * t + angle)
myY = y + 20 * P5.sin(2 * P5.PI * t + angle)
P5.ellipse(myX, myY, 10)
t = t + 0.01
console.log(P5.frameRate())
for x in range(0, width, 30):
for y in range(0, height, 30):
angle = xAngle * (x / width) + yAngle * (y / height)
myX = x + 20 * P5.cos(2 * P5.PI * t + angle)
myY = y + 20 * P5.sin(2 * P5.PI * t + angle)
P5.ellipse(myX, myY, 10)
t = t + 0.01
console.log(P5.frameRate())
my_p5 = start_p5(setup, draw)
def setup():
P5.createCanvas(600, 600)
P5.noStroke()
P5.fill(40, 200, 40)
def setup():
P5.createCanvas(600, 600)
P5.noStroke()
P5.fill(40, 200, 40)