mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-11 01:04:07 +02:00
refactor: use cross
This commit is contained in:
@@ -1,9 +1,4 @@
|
||||
function tri_is_ccw(shape_pts) =
|
||||
let(
|
||||
p1 = shape_pts[0],
|
||||
p2 = shape_pts[1],
|
||||
p3 = shape_pts[2],
|
||||
area = (p2[0] - p1[0]) * (p3[1] - p1[1]) - (p3[0] - p1[0]) * (p2[1] - p1[1])
|
||||
)
|
||||
let(area = cross(shape_pts[1] - shape_pts[0], shape_pts[2] - shape_pts[0]))
|
||||
assert(area != 0, "points are collinear")
|
||||
area > 0;
|
Reference in New Issue
Block a user