Ignore example images
Remove pointless pointers

Segments are pointers for good reason, but angles and vectors can just
be values.
Solve iteratively

Rather than scanning the entire solution space at a constant step size,
scan it iteratively, decreasing the space and step size each time. This
is usually faster and more accurate.