Demos: ensure 720px wide, reduce indentation

This commit is contained in:
Abe Pazos
2025-01-24 23:05:40 +01:00
parent ca8fbc1c0a
commit f84bf69713
31 changed files with 961 additions and 964 deletions

View File

@@ -6,24 +6,23 @@ import kotlin.math.PI
import kotlin.math.cos
import kotlin.math.sin
fun main() {
application {
configure {
width = 720
height = 720
}
program {
extend {
drawer.clear(ColorRGBa.BLACK)
drawer.stroke = ColorRGBa.PINK
drawer.fill = null
fun f(v: Vector2): Double {
val p = v + Vector2(cos(v.y * 0.1 + seconds) * 40.0, sin(v.x * 0.1 + seconds) * 40.0)
return cos((p.distanceTo(drawer.bounds.center) / 720.0) * 12 * PI)
}
val contours = findContours(::f, drawer.bounds.offsetEdges(-2.0), 4.0)
drawer.contours(contours)
fun main() = application {
configure {
width = 720
height = 720
}
program {
extend {
drawer.clear(ColorRGBa.BLACK)
drawer.stroke = ColorRGBa.PINK
drawer.fill = null
fun f(v: Vector2): Double {
val p = v + Vector2(cos(v.y * 0.1 + seconds) * 40.0, sin(v.x * 0.1 + seconds) * 40.0)
return cos((p.distanceTo(drawer.bounds.center) / 720.0) * 12 * PI)
}
val contours = findContours(::f, drawer.bounds.offsetEdges(-2.0), 4.0)
drawer.contours(contours)
}
}
}
}