1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-17 20:11:50 +02:00
This commit is contained in:
Justin Lin
2020-05-18 17:32:52 +08:00
parent 748ed1a35b
commit 40c440f2c6

View File

@@ -0,0 +1,23 @@
# lines_intersection2
Find the intersection of two line segments. Return `[]` if lines don't intersect.
**Since:** 2.4
## Parameters
- `line1` : Two points of 2D line1.
- `line2` : Two points of 2D line2.
- `ext` : Default to `false`, which doesn't extend a line to an intersection with another line.
- `epsilon` : An upper bound on the relative error due to rounding in floating point arithmetic. Default to 0.0001.
## Examples
use <lines_intersection2.scad>;
line1 = [[0, 0], [0, 10]];
line2 = [[5, 0], [-5, 5]];
line3 = [[5, 0], [2.5, 5]];
assert(lines_intersection2(line1, line2) == [0, 2.5]);
assert(lines_intersection2(line1, line3, ext = true) == [0, 10]);