Cut a line into N segments

How to Cut a line into N segments
using just a compass and a straightedge

Here we cut a line into 3 segments, but the same approach can be used to cut a line into any number of segments:

images/construct.js?mode=segment3

Steps: