PDA

View Full Version : Locating Pixels with Bresenham's line algorithm


armin11
Apr1-11, 09:26 AM
hi,I wanted to locate the pixels of a line drawn from (0,0) to (-4,-8) with bresenham's algorithm.I couldn't find a suitable algorithm for finding these pixel locations.Can anyone help me please?(the algorithm can be without computer and work by hand)

Bill Simpson
Apr1-11, 09:49 AM
A very powerful secret method of finding excellent information: Google
wiki <<<brief clear name of what you are looking for>>>

Example
http://www.google.com/search?q=wiki+bresenham%27s+algorithm

armin11
Apr1-11, 12:56 PM
I've searched so much and tried every algorithm they have written ,but they don't work.can anybody help plz?

Grep
Apr1-11, 02:27 PM
This smells like a homework question... In which case you're in the wrong forum.

Also not a hard one. The wiki has full (and rather simple) pseudocode for Bresenham's. Can you really not turn that into working code? That's all you need to do.