Answer to Question #272795 in Java | JSP | JSF for King

Question #272795

write a code for bresenham line drawing algorithm in processing.org


1
Expert's answer
2021-11-29T18:45:45-0500
 static void bresenham(int num, int num2, int R, int R2) 
    { 
        int new1 = 2 * (R2 - num2); 
        int SError = new1 - (R - num); 
      
        for (int x = num, y = num2; x <= R; x++) 
        { 
            System.out.print("(" +x + "," + y + ")\n");
            SError += new1;  
            if (SError >= 0) 
            { 
                y++; 
                SError -= 2 * (R - num); 
            } 
        } 
    }

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS