2D geometry algorithms in ANSI C.