
CK Kashyap
line' (x1, y1) (x2, y2) deltax deltay ystep isSteep error | x1 == x2 = if isSteep then [(y1, x1)] else [(x1, y1)] | isSteep = (y1, x1) : line' (newX, newY) (x2, y2) deltax deltay ystep isSteep newError | otherwise = (x1, y1) : line' (newX, newY) (x2, y2) deltax deltay ystep isSteep newError where newX = x1 + 1 tempError = error + deltay (newY, newError) = if (2 * tempError) >= deltax then (y1 + ystep, tempError - deltax) else (y1, tempError)
It's early in my day, so I'm not very awake, but this looks like it could be an iterate or something like that, rather than explicit recursion. -- Jón Fairbairn Jon.Fairbairn@cl.cam.ac.uk