[orx-noise] Add tools for functional composition
This commit is contained in:
14
orx-noise/src/commonMain/kotlin/Vector.kt
Normal file
14
orx-noise/src/commonMain/kotlin/Vector.kt
Normal file
@@ -0,0 +1,14 @@
|
||||
package org.openrndr.extra.noise
|
||||
|
||||
import org.openrndr.math.Vector2
|
||||
|
||||
fun ((Int, Double) -> Double).vector2(): (seed: Int, x: Double) -> Vector2 {
|
||||
val ref = this
|
||||
return { seed:Int, x:Double ->
|
||||
Vector2(ref(-seed, x), ref(seed, -x))
|
||||
}
|
||||
}
|
||||
|
||||
private fun exampleVector() {
|
||||
::simplex2D
|
||||
}
|
||||
Reference in New Issue
Block a user