lines = {
const NUM_LINES = 50
const N_SAMPLES = 50
const length = 600
const inputArray = Array(NUM_LINES).fill(0)
const xArray = Array(N_SAMPLES).fill(0)
const rows = inputArray.map((n, i) =>
xArray.map((n, j) => {
const x = 150 + j * (length / N_SAMPLES)
const distanceToCenter = Math.abs(j * (length / N_SAMPLES) - length / 2)
const random =
(Math.random() *
(distanceToCenter + 90 - length / 2) *
Math.max(250 - distanceToCenter, 0)) /
length
const y = 150 + i * (length / N_SAMPLES) + random
return [x, y]
})
)
return rows
}