Article | 70002404 |
Type | Wish |
Product | WebJS |
Version | 1004 |
Date Added | 9/13/2023 12:00:00 AM |
Fixed | 10.1005.0.1 (9/13/2023 12:00:00 AM) |
Submitted by | prizmayazilim |
Summary
Export Web library lines intersection function
Solution
In version 1005.0.1 new method was exported
vdgeo.IntersectionLL2D(p1, p2, p3, p4, equality, retpt);
Calculates the intersection point between two lines that belong to the same plane(z values of the lines are equal).
p1 : First point of the first line.
p2" Second point of the first line.
p3: First point of the second line.
p4" Second point of the second line.
equality: Equality to be used to compares points that are nearly identical or distances very close to zero.Usually vdgeo.DefaultPointEquality
retpt: A preallocated point as array of 3 doubles(x,y,z) filled with intersection point if exist.
returns: 0 for no intersection 1 if intersection point found.
Example
var retpt = [0, 0, 0];
var ret = vdgeo.IntersectionLL2D([0, 0, 0], [1, 1, 0], [1, 0, 0], [0, 1, 0], vdgeo.DefaultPointEquality, retpt);
//ret is 1 and retpt if modify as [0.5,0.5,0.0]