1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-30 01:40:02 +02:00

refactor: vector minus

This commit is contained in:
Justin Lin
2022-04-12 09:40:48 +08:00
parent 903caed63c
commit db0d381ceb

View File

@@ -2,12 +2,9 @@ use <__comm__/__in_line.scad>;
function _in_shape_in_line_equation(edge, pt) =
let(
x1 = edge[0].x,
y1 = edge[0].y,
x2 = edge[1].x,
y2 = edge[1].y,
a = (y2 - y1) / (x2 - x1),
b = y1 - a * x1
v = edge[1] - edge[0],
a = v.y / v.x,
b = edge[0].y - a * edge[0].x
)
(pt.y == a * pt.x + b);