Skip to content

implement Bresenham's integer line drawing algorithm correctly, for lines of all slopes

Notifications You must be signed in to change notification settings

johnchen77w/Bresenham-Integer-Line-Drawing-Algorithm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Bresenham-Integer-Line-Drawing-Algorithm

// This is only Octant 1, for the rest of 7 Octants, look through the code
begin
plot (x1, y1) ;
for (i= x1 to x2 by step of 1) {
    if (i== x1 ) { 
        pi=2Δy−Δx ;
    } else {
        if ( pi<0 ) {
            pi=pi+2Δy ;
        } else {
            pi=pi+2Δy−2Δx; 
            y1 ++ ;
        }
    x1 ++ ;
    plot (x1, y1) ;
    }
}
end

About

implement Bresenham's integer line drawing algorithm correctly, for lines of all slopes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages