# Intersect Subnetwork

When drawing in NodeBox I often need to find the point where two lines intersect. It surprises me that there is not a core node to do this - so I finally made one myself. (The compound node does intersections but only works with shapes.)

The intersect node (subnetwork) is very simple. It takes two lines as input and outputs the point where they intersect. If the two lines are parallel or coincident, it returns nothing. That's it.

As a demo I include a network that mimics a compass and straightedge construction to show how a decagon can be found inside a pentagon with an edge of the decagon sharing the middle of a pentagon edge. To find the exact position and radius of the decagon I need to take several lines connecting vertices of the pentagon; one intersection marks the center of the decagon, the other establishes its radius.

The resulting construction diagram is shown in the screenshot for this network. The two intersection points are marked with small circles.

I also include a screenshot of the intersect subnetwork. It employs a purely mathematical method involving matrix determinants - essentially a big equation full of nothing but multiplications and subtractions. (I also do a test to avoid division by zero errors.). NodeBox is particularly cumbersome when it comes to complex equations like this. What would take a few seconds to type in a normal language takes fifteen minutes of careful wiring to construct a sprawling network in NodeBox. The end result is either beautiful or ridiculous depending on your point of view.

If you make something cool using my intersect node, please consider sharing it in this forum.

John

- decagon_screenshot.png 525 KB
- interesect_network.png 525 KB
- intersect_node_decagon_example.zip 3.23 KB

# Keyboard shortcuts

### Generic

? | Show this help |
---|---|

ESC | Blurs the current field |

### Comment Form

r | Focus the comment reply box |
---|---|

^ + ↩ | Submit the comment |

You can use `Command ⌘`

instead of `Control ^`

on Mac