Filaments
Ported to Coracle from www.dwitter.net/d/26504
import coracle.Color
import coracle.Colour
import coracle.Drawing
import coracle.randomInt
import kotlin.math.cos
import kotlin.math.sin
class Filaments: Drawing() {
private val bg = Colour(0x1d1d1d)
override fun setup() {
(800, 450)
size(0xffffff)
stroke}
override fun draw() {
(bg)
background
var Z = -1.00
var y = -1.00
for (i in -1000..1000 step 1){
val ii = i.toFloat()/1000.00
val X= ii * 2.5 + sin(Z/52.0) / 5.0
= 5 * cos(ii * y - 4)
y = 8 + y * sin(3*ii+(frame/100.0)) * 40.0
Z ((width/2) + (width/6)*X, (height/2) + Z+y)
point
= 4 * cos(ii * y - 4)
y = 8 + y * sin(3*ii+(frame/100.0)) * 40.0
Z ((width/2) + (width/6)*X, (height/2) + Z+y)
point
= 5 * sin(ii * y - 4)
y = 8 + y * cos(3*ii+(frame/100.0)) * 40.0
Z ((width/2) + (width/6)*X, (height/2) + Z+y)
point
= 4 * sin(ii * y - 4)
y = 8 + y * cos(3*ii+(frame/100.0)) * 40.0
Z ((width/2) + (width/6)*X, (height/2) + Z+y)
point}
}
}