This is an algorithm for drawing contour lines using number lines and triangles.

It works well as long as the datpoints differ from the value of the contour lines. In such a case, draw to the point and then start drawing triangles from the last one on the right until you find a number line you can cross. Back to index