In lline.c, line: pt.y = p0.x + lp -> rect.origin.x; should be changed to: pt.y = p0.y + lp -> rect.origin.y; You won't see the problem with the radial line test (-t1) but you'll have lots of errors in the hilbert curve (-t2) and sierpinski curve (-t3) tests.