Table of contents
LineSecting
For the 22nd Prompt Of Mathober: Movable, LineSecting showcases a movable intersection that repeatedly moves in P5JS
Poem
Energy is spending
Sending into all arrays
All aspects
But now at the intersect
We must decide which way
Will let our mind ease & flow
Glow and gleams
As it slow-ly let outs the steam
Video
Code
P5JS
function setup() {
createCanvas(800, 400);
}
function draw() {
background(randomGaussian(220,13),randomGaussian(100,13),random(100,170));
blueBlur();
redBlur();
}
function blueBlur()
{
fill("blue")
let x = randomGaussian(150,3);
let y = random(5,8);
rect(y * random(20,60),x,40,310);
filter(DILATE,randomGaussian(130,4));
filter(BLUR,randomGaussian(10,3));
}
function redBlur()
{
fill("yellow")
if (second() % 8 > 5)
{
ellipse(10 + 2 * random(10,15),20 * (second() % 12),20 * (second() % 12));
filter(DILATE,randomGaussian(130,4));
filter(BLUR,randomGaussian(10,3));
}
else
{
ellipse(100 - random(10,30),30 * (second() % 12),10 * (second() % 12));
filter(ERODE,randomGaussian(10,3));
filter(DILATE,randomGaussian(130,4));
filter(BLUR,randomGaussian(10,3));
}
}