Skip to main content

Scan Conversion(Circle) - Midpoint Algorithm

Assignment 05.
  1. Use the mid-point circle technique to derive the necessary equations to scan convert the following circular sector (i.e., points from 270o to 315o). 
  2. Implement your method and use the circle's symmetric property to draw complete circles.
  3.  
  4. The file is available here (ScanConvertCirclemidpoint.cpp)
  5. Play with it. You will understand..

Comments


  1. this code also correct!!
    void MidpointCircle(GLint x1, GLint y1, GLint x2, GLint y2){
    /********************************************************************
    This function draws a Circle using the Midpoint Circle algorithm for 270 - 315
    *********************************************************************/
    float r1 = (x2-x1)(x2-x1) + (y2-y1)(y2-y1);
    float r = sqrt(r1);
    int x=0,y=-r,p=1-r;
    while(x<=-y)
    {
    plot(x1+x,y1+y);

    if(p<0)
    {
    p=p+2*x+3;
    }
    else
    {

    p=p+2*(x+y)+5;
    y++;
    }
    x++;
    }

    }

    ReplyDelete

Post a Comment

Popular posts from this blog

Raising cryptography’s standards

Calculating encryption schemes’ theoretical security guarantees eases comparison, improvement. Most modern cryptographic schemes rely on computational complexity for their security. In principle, they can be cracked, but that would take a prohibitively long time, even with enormous computational resources. There is, however, another notion of security — information-theoretic security — which means that even an adversary with unbounded computational power could extract no useful information from an encrypted message. Cryptographic schemes that promise information-theoretical security have been devised, but they’re far too complicated to be practical. In a series of papers presented at the Allerton Conference on Communication, Control, and Computing, researchers at MIT and Maynooth University in Ireland have shown that existing, practical cryptographic schemes come with their own information-theoretic guarantees: Some of the data they encode can’t be extracted, even by a ...

TrashCoders

As I'm forming a Club "TrashCoders" after our Summer Holidays (May 2nd week), and going to share the knowledge I have, I created a new blog to upload all of the works we do in the Club. Hope you guys have some ideas and/or tips. Trash Coders  Happy Holidays..