1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-18 20:41:18 +02:00

add tri_is_ccw

This commit is contained in:
Justin Lin
2021-08-26 18:49:42 +08:00
parent 21754293c8
commit 679e3aae62

View File

@@ -0,0 +1,6 @@
function tri_is_ccw(p1, p2, p3) =
let(
area = (p2[0] - p1[0]) * (p3[1] - p1[1]) - (p3[0] - p1[0]) * (p2[1] - p1[1]),
_ = assert(area != 0, "points are collinear")
)
area > 0;