# Mathober2024_Set

# **LineSecting2**

For the 15th piece of Mathober2024, the 28th prompt: **Set** is used to showcase sets of intersecting lines that merge with other lines to make the colors seen on the screen. ***LineSecting2*** *coded with* ***P5js, Hydra & Sonicpi*** is a remake of last year’s peice***, LineSecting (***[https://blog.illestpreacha.com/mathober2023movable](https://blog.illestpreacha.com/mathober2023movable)).

## Poem

```ocaml
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

%[https://youtu.be/mcawL6wmGRQ] 

## Code

### Hydra

```javascript
s0.initScreen()

src(s0).repeat([4,3,2,1].smooth(),[2,3,4]).
modulateRotate(src(s0).scale([0.5,1,2].smooth()),0.5).
modulateScale(src(s0).diff(src(s0).kaleid(5)).scale([0.5,1,2].smooth()),0.5).
out()
```

### P5JS

```ocaml
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));
    }

}
```
