[orx-triangulation] Add smoothScatter
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
package org.openrndr.extra.triangulation
|
||||
|
||||
internal fun orient2d(bx: Double, by: Double, ax: Double, ay: Double, cx: Double, cy: Double): Double {
|
||||
fun orient2d(bx: Double, by: Double, ax: Double, ay: Double, cx: Double, cy: Double): Double {
|
||||
// (ax,ay) (bx,by) are swapped such that the sign of the determinant is flipped. which is what Delaunator.kt expects.
|
||||
|
||||
/*
|
||||
@@ -8,12 +8,12 @@ internal fun orient2d(bx: Double, by: Double, ax: Double, ay: Double, cx: Double
|
||||
| c d | | bx - cx by - cy |
|
||||
*/
|
||||
|
||||
val a = ax - cx
|
||||
val b = ay - cy
|
||||
val c = bx - cx
|
||||
val d = by - cy
|
||||
val a = twoDiff(ax, cx)
|
||||
val b = twoDiff(ay, cy)
|
||||
val c = twoDiff(bx, cx)
|
||||
val d = twoDiff(by, cy)
|
||||
|
||||
val determinant = ddDiffDd(twoProduct(a, d), twoProduct(b, c))
|
||||
val determinant = ddDiffDd(ddMultDd(a, d), ddMultDd(b, c))
|
||||
|
||||
return determinant[1]
|
||||
}
|
||||
Reference in New Issue
Block a user