[Haskell-cafe] Line drawing algorithm

2009-07-17 Thread CK Kashyap
Hi All, I am working on a diagraming utility in Haskell. I started with line drawing. I am doing the basic stuff using the y = mx + c formula to draw a line between (x1,y1) and (x2,y2) Here's what I need to do - if dx dy where dx = (x2 - x1) and dy = (y2 - y1) then I need to vary x between

Re: [Haskell-cafe] Line drawing algorithm

2009-07-17 Thread Neil Brown
CK Kashyap wrote: Hi All, I am working on a diagraming utility in Haskell. I started with line drawing. I am doing the basic stuff using the y = mx + c formula to draw a line between (x1,y1) and (x2,y2) Hi, Are you doing this to learn Haskell, learn about drawing lines, or to just get it

Re: [Haskell-cafe] Line drawing algorithm

2009-07-17 Thread CK Kashyap
Thanks Neil ... Are you doing this to learn Haskell, learn about drawing lines, or to just get it implemented? If either of the latter two, when drawing a straight line you shouldn't need to do floating point operations such as this: Actually, my reasons are first and third. newY =