Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //get all combinations of 4 distinct points from the collection
- foreach(getFourPoints in collection.AllFourPointCombinations()){
- //make two lines from the points
- line1=line(getFourPoints.p1,getFourPoints.p2);
- line2=line(getFourPoints.p3,getFourPoints.p4);
- //find the intersection of the lines
- intersection=line1.intersect(line2);
- //check if the intersection is not yet in the point collection
- if (!collection.points.includes(intersection)){
- //add intersection to the point collection
- collection.points.add(intersection);
- //add the lines to the existing graph of lines
- addToGraph(line1,line2);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement