{
private:
int x1, x2, y1, y2, algoID;
public :
{
}
Line(int algoID,
int x1,
int x2,
int y1,
int y2
) {
this->algoID = algoID ;
this->x1 = x1 ;
this->x2 = x2 ;
this->y1 = y1 ;
this->y2 = y2 ;
}
int getX1()
{
return x1 ;
}
int getX2()
{
return x2 ;
}
int getY1()
{
return y1 ;
}
int getY2()
{
return y2 ;
}
int getM()
{
return algoID ;
}
};
class elipse
{
private:
int xc , yc, a, b, algoID ;
public :
elipse()
{
}
elipse(int algoID,int xc, int x, int yc, int y)
{
this->algoID = algoID ;
this->xc = xc ;
this->a = x ;
this->yc = yc ;
this->b = y ;
}
int getXc()
{
return xc ;
}
int getA()
{
return a ;
}
int getYc()
{
return yc ;
}
int getB()
{
return b ;
}
int getM()
{
return algoID ;
}
};
class Circle
{
private:
int xc , yc, x, y, algoID ;
public:
Circle()
{
}
Circle(int algoID,int xc, int x, int yc, int y)
{
this->algoID = algoID ;
this->xc = xc ;
this->x = x ;
this->yc = yc ;
this->y = y ;
}
int getXc()
{
return xc ;
}
int getX()
{
return x ;
}
int getYc()
{
return yc ;
}
int getY()
{
return y ;
}
int getM()
{
return algoID ;
}
};
///////////////////////////////////////////////////////////
/* Declare Windows procedure */
LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM);
/* Make the class name into a global variable */
TCHAR szClassName[ ] = _T("CodeBlocksWindowsApp");
void swap (int &x1 , int &x2 , int &y1 , int &y2)
{
int temp = x1;
x1 = x2;
x2 = temp;
temp = y1;
y1 = y2;
y2 = temp;
}
void draw4Points(HDC hdc,int xc , int yc , int x , int y, COLORREF color )
{
SetPixel(hdc , xc + x , yc + y , color);
SetPixel(hdc , xc - x , yc - y , color);
SetPixel(hdc , xc + x , yc - y , color);
SetPixel(hdc , xc - x , yc + y , color);
}
void draw8Points(HDC hdc,int xc , int yc , int x , int y, COLORREF color )
{
SetPixel(hdc , xc + x , yc + y , color);
SetPixel(hdc , xc - x , yc - y , color);
SetPixel(hdc , xc + x , yc - y , color);
SetPixel(hdc , xc - x , yc + y , color);
SetPixel(hdc , xc + y , yc + x , color);
SetPixel(hdc , xc - y , yc - x , color);
SetPixel(hdc , xc - y , yc + x , color);
SetPixel(hdc , xc + y , yc - x , color);
}
void drawElipseCartesian(HDC hdc, int xc, int yc, int a, int b)
{
int x = 0 , y= b ;
COLORREF color=RGB(255,80,0);
draw4Points(hdc,xc,yc,x,y,color);
while (x*b*b<=y*a*a)
{
x++;
y=b*sqrt(1-((x*x)/(a*a)));
draw4Points(hdc,xc,yc,x,y, color);
}
x=a , y =0 ;
draw4Points(hdc,xc,yc,x,y, color);
while (y*a*a<=x*b*b)
{
y++;
x=a*sqrt(1-((y*y)/(b*b)));
draw4Points(hdc,xc,yc,x,y, color);
}
}
void drawCircleDirect(HDC hdc, int xc, int yc, int x, int y)
{
COLORREF color=RGB(255,80,0);
int R = sqrt((double)((x-xc)*(x-xc) + (y-yc)*(y-yc)));
x = 0 ;
y = R ;
int R2 = R*R ;
draw8Points(hdc, xc , yc , x , y , color);
while(x < y)
{
x++ ;
y = sqrt((double)(R2 - x*x));
draw8Points(hdc, xc , yc , x , y , color);
}
}
void drawCirclePolar(HDC hdc, int xc, int yc, int xt, int yt)
{
COLORREF color=RGB(10,10,0);
double x = xt , y = yt ;
double r = sqrt((x-xc)*(x-xc) + (y-yc)*(y-yc));
x = r, y = 0;
double dTh = 1.0/r;
double cosdTh = cos(dTh);
double sindTh = sin(dTh);
draw8Points(hdc, xc , yc , x , y , color);
while(x>y)
{
x = x*cosdTh - y*sindTh ;
y = x*sindTh + y*cosdTh;
draw8Points(hdc, xc , yc , x , y , color);
}
}
void drawCircleParametric (HDC hdc, int xc, int yc, int x, int y)
{
COLORREF color=RGB(255,150,70);
int r = sqrt((x-xc)*(x-xc) + (y-yc)*(y-yc));
x = r;
y = 0;
draw8Points(hdc, xc , yc , x , y , color);
double theta=0, dtheta=1.0/r;
while (x>y)
{
theta += dtheta;
x = round(r*cos(theta));
y = round(r*sin(theta));
draw8Points(hdc, xc , yc , x , y , color);
}
}
void drawCircleMidPoint (HDC hdc, int xc, int yc, int x, int y)
{
COLORREF color=RGB(10,10,200);
int r = sqrt((x-xc)*(x-xc) + (y-yc)*(y-yc));
x = 0;
y = r;
draw8Points(hdc, xc , yc , x , y , color);
int d = 1-r;
while (x<y)
{
x++;
if (d>=0)
{
y--;
d+=( (2*(x-y)) +3 );
}
else
{
d+=( (2*(x)) +1 );
}
draw8Points(hdc, xc , yc , x , y , color);
}
}
void drawlineCartesian(HDC hdc, int x1, int y1, int x2, int y2)
{
COLORREF color=RGB(255,255,0);
int dx = x2 - x1;
int dy = y2 - y1;
double m = (double)dy / (double)dx ; // slope
double c = (y1 - (m*x1) ); // y-intercept
if ( abs(dx) >= abs (dy) ) // m<1
{
if (x2 < x1)
{
swap(x1 , x2 , y1 , y2);
}
SetPixel(hdc, x1, y1, color);
double y = y1;
while (x1 < x2)
{
x1++;
y = ( (m*(double)x1) + c );
SetPixel(hdc, x1, round(y), color);
}
}
else if (abs(dx) < abs(dy)) // m>1
{
if (y2 < y1)
{
swap(x1 , x2 , y1 , y2);
}
SetPixel(hdc, x1, y1, color);
double x = x1;
double d = ( x1 - ((1.0/m)*y1) );
while (y1 < y2)
{
y1++;
x = ( ((1.0/m)*(double)y1) + d );
SetPixel(hdc, round(x) , y1 , color);
}
}
}
void drawlineDDA(HDC hdc, int x1, int y1, int x2, int y2)
{
COLORREF color=RGB(255,0,150);
int dx = x2 - x1;
int dy = y2 - y1;
double m; // slope
double c = (y1 - (m*x1) ); // y-intercept
if ( abs(dx) >= abs (dy) ) // m<1
{
m = (double)dy / (double)dx ;
if (x2 < x1)
{
swap(x1 , x2 , y1 , y2);
}
SetPixel(hdc, x1, y1, color);
double y = y1;
while (x1 < x2)
{
x1++;
y += m;
SetPixel(hdc, x1, round(y), color);
}
}
else if (abs(dx) < abs(dy)) // m>1
{
m = (double)dx / (double)dy ;
if (y2 < y1)
{
swap(x1 , x2 , y1 , y2);
}
SetPixel(hdc, x1, y1, color);
double x = x1;
double d = ( x1 - (m*y1) );
while (y1 < y2)
{
y1++;
x += m;
SetPixel(hdc, round(x) , y1 , color);
}
}
}
void drawlineParametric(HDC hdc, int x1, int y1, int x2, int y2)
{
COLORREF color = RGB(0,0,0);
int dx=x2-x1;
int dy=y2-y1;
int x=x1;
int y=y1;
float ro ;
if(dx > dy)
ro = 1.0/dx ;
else
ro = 1.0 / dy ;
for (float i =0;i<1;i+=ro)
{
x= x1 + int(i*dx);
y= y1 + int(i*dy);
SetPixel(hdc,x,y,color);
}
}
Y2xhc3MgTGluZQp7CiAgICBwcml2YXRlOgogICAgICAgIGludCB4MSwgeDIsIHkxLCB5MiwgYWxnb0lEOwoKICAgIHB1YmxpYyA6CiAgICBMaW5lKCkKICAgIHsKCiAgICB9CiAgICBMaW5lKGludCBhbGdvSUQsaW50IHgxLCBpbnQgeDIsIGludCB5MSwgaW50IHkyKQogICAgewogICAgICAgIHRoaXMtPmFsZ29JRCA9IGFsZ29JRCA7CiAgICAgICAgdGhpcy0+eDEgPSB4MSA7CiAgICAgICAgdGhpcy0+eDIgPSB4MiA7CiAgICAgICAgdGhpcy0+eTEgPSB5MSA7CiAgICAgICAgdGhpcy0+eTIgPSB5MiA7CiAgICB9CiAgICBpbnQgZ2V0WDEoKQogICAgewogICAgICAgIHJldHVybiB4MSA7CiAgICB9CiAgICBpbnQgZ2V0WDIoKQogICAgewogICAgICAgIHJldHVybiB4MiA7CiAgICB9CiAgICBpbnQgZ2V0WTEoKQogICAgewogICAgICAgIHJldHVybiB5MSA7CiAgICB9CiAgICBpbnQgZ2V0WTIoKQogICAgewogICAgICAgIHJldHVybiB5MiA7CiAgICB9CiAgICBpbnQgZ2V0TSgpCiAgICB7CiAgICAgICAgcmV0dXJuIGFsZ29JRCA7CiAgICB9Cgp9OwpjbGFzcyBlbGlwc2UKewogICAgcHJpdmF0ZToKICAgICBpbnQgeGMgLCB5YywgYSwgYiwgYWxnb0lEIDsKICAgIHB1YmxpYyA6CiAgICAgICAgZWxpcHNlKCkKICAgICAgICB7CgogICAgICAgIH0KICAgICAgICBlbGlwc2UoaW50IGFsZ29JRCxpbnQgeGMsIGludCB4LCBpbnQgeWMsIGludCB5KQogICAgICAgIHsKICAgICAgICAgICAgdGhpcy0+YWxnb0lEID0gYWxnb0lEIDsKICAgICAgICAgICAgdGhpcy0+eGMgPSB4YyA7CiAgICAgICAgICAgIHRoaXMtPmEgPSB4IDsKICAgICAgICAgICAgdGhpcy0+eWMgPSB5YyA7CiAgICAgICAgICAgIHRoaXMtPmIgPSB5IDsKICAgICAgICB9CiAgICAgICAgaW50IGdldFhjKCkKICAgICAgICB7CiAgICAgICAgICAgIHJldHVybiB4YyA7CiAgICAgICAgfQogICAgICAgIGludCBnZXRBKCkKICAgICAgICB7CiAgICAgICAgICAgIHJldHVybiBhIDsKICAgICAgICB9CiAgICAgICAgaW50IGdldFljKCkKICAgICAgICB7CiAgICAgICAgICAgIHJldHVybiB5YyA7CiAgICAgICAgfQogICAgICAgIGludCBnZXRCKCkKICAgICAgICB7CiAgICAgICAgICAgIHJldHVybiBiIDsKICAgICAgICB9CiAgICAgICAgaW50IGdldE0oKQogICAgICAgIHsKICAgICAgICAgICAgcmV0dXJuIGFsZ29JRCA7CiAgICAgICAgfQoKfTsKY2xhc3MgQ2lyY2xlCnsKICAgIHByaXZhdGU6CiAgICAgICAgaW50IHhjICwgeWMsIHgsIHksIGFsZ29JRCA7CiAgICBwdWJsaWM6CiAgICAgICAgQ2lyY2xlKCkKICAgICAgICB7CgogICAgICAgIH0KICAgICAgICBDaXJjbGUoaW50IGFsZ29JRCxpbnQgeGMsIGludCB4LCBpbnQgeWMsIGludCB5KQogICAgICAgIHsKICAgICAgICAgICAgdGhpcy0+YWxnb0lEID0gYWxnb0lEIDsKICAgICAgICAgICAgdGhpcy0+eGMgPSB4YyA7CiAgICAgICAgICAgIHRoaXMtPnggPSB4IDsKICAgICAgICAgICAgdGhpcy0+eWMgPSB5YyA7CiAgICAgICAgICAgIHRoaXMtPnkgPSB5IDsKICAgICAgICB9CiAgICAgICAgaW50IGdldFhjKCkKICAgICAgICB7CiAgICAgICAgICAgIHJldHVybiB4YyA7CiAgICAgICAgfQogICAgICAgIGludCBnZXRYKCkKICAgICAgICB7CiAgICAgICAgICAgIHJldHVybiB4IDsKICAgICAgICB9CiAgICAgICAgaW50IGdldFljKCkKICAgICAgICB7CiAgICAgICAgICAgIHJldHVybiB5YyA7CiAgICAgICAgfQogICAgICAgIGludCBnZXRZKCkKICAgICAgICB7CiAgICAgICAgICAgIHJldHVybiB5IDsKICAgICAgICB9CiAgICAgICAgaW50IGdldE0oKQogICAgICAgIHsKICAgICAgICAgICAgcmV0dXJuIGFsZ29JRCA7CiAgICAgICAgfQp9OwovLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLwovKiAgRGVjbGFyZSBXaW5kb3dzIHByb2NlZHVyZSAgKi8KTFJFU1VMVCBDQUxMQkFDSyBXaW5kb3dQcm9jZWR1cmUgKEhXTkQsIFVJTlQsIFdQQVJBTSwgTFBBUkFNKTsKCi8qICBNYWtlIHRoZSBjbGFzcyBuYW1lIGludG8gYSBnbG9iYWwgdmFyaWFibGUgICovClRDSEFSIHN6Q2xhc3NOYW1lWyBdID0gX1QoIkNvZGVCbG9ja3NXaW5kb3dzQXBwIik7Cgp2b2lkIHN3YXAgKGludCAmeDEgLCBpbnQgJngyICwgaW50ICZ5MSAsIGludCAmeTIpCnsKICAgIGludCB0ZW1wID0geDE7CiAgICB4MSA9IHgyOwogICAgeDIgPSB0ZW1wOwoKICAgIHRlbXAgPSB5MTsKICAgIHkxID0geTI7CiAgICB5MiA9IHRlbXA7Cn0Kdm9pZCBkcmF3NFBvaW50cyhIREMgaGRjLGludCB4YyAsIGludCB5YyAsIGludCB4ICwgaW50IHksIENPTE9SUkVGIGNvbG9yICkKewogICAgU2V0UGl4ZWwoaGRjICwgeGMgKyB4ICwgeWMgKyB5ICwgY29sb3IpOwogICAgU2V0UGl4ZWwoaGRjICwgeGMgLSB4ICwgeWMgLSB5ICwgY29sb3IpOwogICAgU2V0UGl4ZWwoaGRjICwgeGMgKyB4ICwgeWMgLSB5ICwgY29sb3IpOwogICAgU2V0UGl4ZWwoaGRjICwgeGMgLSB4ICwgeWMgKyB5ICwgY29sb3IpOwoKfQp2b2lkIGRyYXc4UG9pbnRzKEhEQyBoZGMsaW50IHhjICwgaW50IHljICwgaW50IHggLCBpbnQgeSwgQ09MT1JSRUYgY29sb3IgKQp7CgogICAgU2V0UGl4ZWwoaGRjICwgeGMgKyB4ICwgeWMgKyB5ICwgY29sb3IpOwogICAgU2V0UGl4ZWwoaGRjICwgeGMgLSB4ICwgeWMgLSB5ICwgY29sb3IpOwogICAgU2V0UGl4ZWwoaGRjICwgeGMgKyB4ICwgeWMgLSB5ICwgY29sb3IpOwogICAgU2V0UGl4ZWwoaGRjICwgeGMgLSB4ICwgeWMgKyB5ICwgY29sb3IpOwogICAgU2V0UGl4ZWwoaGRjICwgeGMgKyB5ICwgeWMgKyB4ICwgY29sb3IpOwogICAgU2V0UGl4ZWwoaGRjICwgeGMgLSB5ICwgeWMgLSB4ICwgY29sb3IpOwogICAgU2V0UGl4ZWwoaGRjICwgeGMgLSB5ICwgeWMgKyB4ICwgY29sb3IpOwogICAgU2V0UGl4ZWwoaGRjICwgeGMgKyB5ICwgeWMgLSB4ICwgY29sb3IpOwp9CnZvaWQgZHJhd0VsaXBzZUNhcnRlc2lhbihIREMgaGRjLCBpbnQgeGMsIGludCB5YywgaW50IGEsIGludCBiKQp7CiAgICBpbnQgeCA9IDAgLCB5PSBiIDsKICAgIENPTE9SUkVGIGNvbG9yPVJHQigyNTUsODAsMCk7CiAgICBkcmF3NFBvaW50cyhoZGMseGMseWMseCx5LGNvbG9yKTsKICAgIHdoaWxlICh4KmIqYjw9eSphKmEpCiAgICB7CiAgICAgICAgeCsrOwogICAgICAgIHk9YipzcXJ0KDEtKCh4KngpLyhhKmEpKSk7CiAgICAgICAgZHJhdzRQb2ludHMoaGRjLHhjLHljLHgseSwgY29sb3IpOwogICAgfQogICAgeD1hICwgeSA9MCA7CiAgICBkcmF3NFBvaW50cyhoZGMseGMseWMseCx5LCBjb2xvcik7CiAgICB3aGlsZSAoeSphKmE8PXgqYipiKQogICAgewogICAgICAgIHkrKzsKICAgICAgICB4PWEqc3FydCgxLSgoeSp5KS8oYipiKSkpOwogICAgICAgIGRyYXc0UG9pbnRzKGhkYyx4Yyx5Yyx4LHksIGNvbG9yKTsKICAgIH0KCn0Kdm9pZCBkcmF3Q2lyY2xlRGlyZWN0KEhEQyBoZGMsIGludCB4YywgaW50IHljLCBpbnQgeCwgaW50IHkpCnsKICAgIENPTE9SUkVGIGNvbG9yPVJHQigyNTUsODAsMCk7CiAgICBpbnQgUiA9IHNxcnQoKGRvdWJsZSkoKHgteGMpKih4LXhjKSArICh5LXljKSooeS15YykpKTsKICAgIHggPSAwIDsKICAgIHkgPSBSIDsKICAgIGludCBSMiA9IFIqUiA7CiAgICBkcmF3OFBvaW50cyhoZGMsIHhjICwgIHljICwgIHggLCAgeSAsIGNvbG9yKTsKICAgIHdoaWxlKHggPCB5KQogICAgewogICAgICAgIHgrKyA7CiAgICAgICAgeSA9IHNxcnQoKGRvdWJsZSkoUjIgLSB4KngpKTsKICAgICAgICBkcmF3OFBvaW50cyhoZGMsIHhjICwgIHljICwgIHggLCAgeSAsIGNvbG9yKTsKICAgIH0KfQoKdm9pZCBkcmF3Q2lyY2xlUG9sYXIoSERDIGhkYywgaW50IHhjLCBpbnQgeWMsIGludCB4dCwgaW50IHl0KQp7CiAgICBDT0xPUlJFRiBjb2xvcj1SR0IoMTAsMTAsMCk7CiAgICBkb3VibGUgeCA9IHh0ICwgeSA9IHl0IDsKICAgIGRvdWJsZSByID0gc3FydCgoeC14YykqKHgteGMpICsgKHkteWMpKih5LXljKSk7CiAgICB4ID0gciwgeSA9IDA7CiAgICBkb3VibGUgZFRoID0gMS4wL3I7CiAgICBkb3VibGUgY29zZFRoID0gY29zKGRUaCk7CiAgICBkb3VibGUgc2luZFRoID0gc2luKGRUaCk7CiAgICBkcmF3OFBvaW50cyhoZGMsIHhjICwgIHljICwgIHggLCAgeSAsIGNvbG9yKTsKICAgIHdoaWxlKHg+eSkKICAgIHsKICAgICAgICB4ID0geCpjb3NkVGggLSB5KnNpbmRUaCA7CiAgICAgICAgeSA9IHgqc2luZFRoICsgeSpjb3NkVGg7CiAgICAgICAgZHJhdzhQb2ludHMoaGRjLCB4YyAsICB5YyAsICB4ICwgIHkgLCBjb2xvcik7CiAgICB9Cn0Kdm9pZCBkcmF3Q2lyY2xlUGFyYW1ldHJpYyAoSERDIGhkYywgaW50IHhjLCBpbnQgeWMsIGludCB4LCBpbnQgeSkKewogICAgQ09MT1JSRUYgY29sb3I9UkdCKDI1NSwxNTAsNzApOwogICAgaW50IHIgPSBzcXJ0KCh4LXhjKSooeC14YykgKyAoeS15YykqKHkteWMpKTsKICAgIHggPSByOwogICAgeSA9IDA7CiAgICBkcmF3OFBvaW50cyhoZGMsIHhjICwgIHljICwgIHggLCAgeSAsIGNvbG9yKTsKCiAgICBkb3VibGUgdGhldGE9MCwgZHRoZXRhPTEuMC9yOwogICAgd2hpbGUgKHg+eSkKICAgIHsKICAgICAgICB0aGV0YSArPSBkdGhldGE7CiAgICAgICAgeCA9IHJvdW5kKHIqY29zKHRoZXRhKSk7CiAgICAgICAgeSA9IHJvdW5kKHIqc2luKHRoZXRhKSk7CiAgICAgICAgZHJhdzhQb2ludHMoaGRjLCB4YyAsICB5YyAsICB4ICwgIHkgLCBjb2xvcik7CgogICAgfQp9CnZvaWQgZHJhd0NpcmNsZU1pZFBvaW50IChIREMgaGRjLCBpbnQgeGMsIGludCB5YywgaW50IHgsIGludCB5KQp7CiAgICBDT0xPUlJFRiBjb2xvcj1SR0IoMTAsMTAsMjAwKTsKICAgIGludCByID0gc3FydCgoeC14YykqKHgteGMpICsgKHkteWMpKih5LXljKSk7CiAgICB4ID0gMDsKICAgIHkgPSByOwogICAgZHJhdzhQb2ludHMoaGRjLCB4YyAsICB5YyAsICB4ICwgIHkgLCBjb2xvcik7CiAgICBpbnQgZCA9IDEtcjsKICAgIHdoaWxlICh4PHkpCiAgICB7CiAgICAgICAgeCsrOwogICAgICAgIGlmIChkPj0wKQogICAgICAgIHsKICAgICAgICAgICAgeS0tOwogICAgICAgICAgICBkKz0oICgyKih4LXkpKSArMyApOwogICAgICAgIH0KICAgICAgICBlbHNlCiAgICAgICAgewogICAgICAgICAgICBkKz0oICgyKih4KSkgKzEgKTsKICAgICAgICB9CiAgICAgICAgZHJhdzhQb2ludHMoaGRjLCB4YyAsICB5YyAsICB4ICwgIHkgLCBjb2xvcik7CiAgICB9Cn0Kdm9pZCBkcmF3bGluZUNhcnRlc2lhbihIREMgaGRjLCBpbnQgeDEsIGludCB5MSwgaW50IHgyLCBpbnQgeTIpCnsKICAgIENPTE9SUkVGIGNvbG9yPVJHQigyNTUsMjU1LDApOwoKICAgIGludCBkeCA9IHgyIC0geDE7CiAgICBpbnQgZHkgPSB5MiAtIHkxOwogICAgZG91YmxlIG0gPSAoZG91YmxlKWR5IC8gKGRvdWJsZSlkeCA7ICAvLyBzbG9wZQogICAgZG91YmxlIGMgPSAoeTEgLSAobSp4MSkgKTsgICAgICAgICAgICAgICAvLyB5LWludGVyY2VwdAoKICAgIGlmICggYWJzKGR4KSA+PSBhYnMgKGR5KSApIC8vIG08MQogICAgewogICAgICAgIGlmICh4MiA8IHgxKQogICAgICAgIHsKICAgICAgICAgICAgc3dhcCh4MSAsIHgyICwgeTEgLCB5Mik7CiAgICAgICAgfQogICAgICAgIFNldFBpeGVsKGhkYywgeDEsIHkxLCBjb2xvcik7CiAgICAgICAgZG91YmxlIHkgPSB5MTsKICAgICAgICB3aGlsZSAoeDEgPCB4MikKICAgICAgICB7CiAgICAgICAgICAgIHgxKys7CiAgICAgICAgICAgIHkgPSAoIChtKihkb3VibGUpeDEpICsgYyApOwogICAgICAgICAgICBTZXRQaXhlbChoZGMsIHgxLCByb3VuZCh5KSwgY29sb3IpOwogICAgICAgIH0KICAgIH0KICAgIGVsc2UgaWYgKGFicyhkeCkgPCBhYnMoZHkpKSAvLyBtPjEKICAgIHsKICAgICAgICBpZiAoeTIgPCB5MSkKICAgICAgICB7CiAgICAgICAgICAgIHN3YXAoeDEgLCB4MiAsIHkxICwgeTIpOwogICAgICAgIH0KICAgICAgICBTZXRQaXhlbChoZGMsIHgxLCB5MSwgY29sb3IpOwoKICAgICAgICBkb3VibGUgeCA9IHgxOwogICAgICAgIGRvdWJsZSBkID0gKCB4MSAtICgoMS4wL20pKnkxKSApOwoKICAgICAgICB3aGlsZSAoeTEgPCB5MikKICAgICAgICB7CiAgICAgICAgICAgIHkxKys7CiAgICAgICAgICAgIHggPSAoICgoMS4wL20pKihkb3VibGUpeTEpICsgZCApOwogICAgICAgICAgICBTZXRQaXhlbChoZGMsIHJvdW5kKHgpICwgeTEgLCBjb2xvcik7CiAgICAgICAgfQogICAgfQp9Cgp2b2lkIGRyYXdsaW5lRERBKEhEQyBoZGMsIGludCB4MSwgaW50IHkxLCBpbnQgeDIsIGludCB5MikKewogICAgQ09MT1JSRUYgY29sb3I9UkdCKDI1NSwwLDE1MCk7CgogICAgaW50IGR4ID0geDIgLSB4MTsKICAgIGludCBkeSA9IHkyIC0geTE7CiAgICBkb3VibGUgbTsgIC8vIHNsb3BlCiAgICBkb3VibGUgYyA9ICh5MSAtIChtKngxKSApOyAgICAgICAgICAgICAgIC8vIHktaW50ZXJjZXB0CgogICAgaWYgKCBhYnMoZHgpID49IGFicyAoZHkpICkgLy8gbTwxCiAgICB7CiAgICAgICAgbSA9IChkb3VibGUpZHkgLyAoZG91YmxlKWR4IDsKICAgICAgICBpZiAoeDIgPCB4MSkKICAgICAgICB7CiAgICAgICAgICAgIHN3YXAoeDEgLCB4MiAsIHkxICwgeTIpOwogICAgICAgIH0KICAgICAgICBTZXRQaXhlbChoZGMsIHgxLCB5MSwgY29sb3IpOwogICAgICAgIGRvdWJsZSB5ID0geTE7CiAgICAgICAgd2hpbGUgKHgxIDwgeDIpCiAgICAgICAgewogICAgICAgICAgICB4MSsrOwogICAgICAgICAgICB5ICs9IG07CiAgICAgICAgICAgIFNldFBpeGVsKGhkYywgeDEsIHJvdW5kKHkpLCBjb2xvcik7CiAgICAgICAgfQogICAgfQogICAgZWxzZSBpZiAoYWJzKGR4KSA8IGFicyhkeSkpIC8vIG0+MQogICAgewogICAgICAgIG0gPSAoZG91YmxlKWR4IC8gKGRvdWJsZSlkeSA7CiAgICAgICAgaWYgKHkyIDwgeTEpCiAgICAgICAgewogICAgICAgICAgICBzd2FwKHgxICwgeDIgLCB5MSAsIHkyKTsKICAgICAgICB9CiAgICAgICAgU2V0UGl4ZWwoaGRjLCB4MSwgeTEsIGNvbG9yKTsKCiAgICAgICAgZG91YmxlIHggPSB4MTsKICAgICAgICBkb3VibGUgZCA9ICggeDEgLSAobSp5MSkgKTsKCiAgICAgICAgd2hpbGUgKHkxIDwgeTIpCiAgICAgICAgewogICAgICAgICAgICB5MSsrOwogICAgICAgICAgICB4ICs9IG07CiAgICAgICAgICAgIFNldFBpeGVsKGhkYywgcm91bmQoeCkgLCB5MSAsIGNvbG9yKTsKICAgICAgICB9CiAgICB9Cn0Kdm9pZCBkcmF3bGluZVBhcmFtZXRyaWMoSERDIGhkYywgaW50IHgxLCBpbnQgeTEsIGludCB4MiwgaW50IHkyKQp7CglDT0xPUlJFRiBjb2xvciA9IFJHQigwLDAsMCk7CiAgICAgaW50IGR4PXgyLXgxOwogICAgIGludCBkeT15Mi15MTsKICAgICBpbnQgIHg9eDE7CiAgICAgaW50ICB5PXkxOwogICAgIGZsb2F0IHJvIDsKCiAgICAgaWYoZHggPiBkeSkKICAgICAgICBybyA9IDEuMC9keCA7CiAgICAgZWxzZQogICAgICAgIHJvID0gMS4wIC8gZHkgOwoKICAgICBmb3IgKGZsb2F0IGkgPTA7aTwxO2krPXJvKQogICAgIHsKCiAgICAgICAgIHg9IHgxICsgaW50KGkqZHgpOwogICAgICAgICB5PSB5MSArIGludChpKmR5KTsKCiAgICAgICAgIFNldFBpeGVsKGhkYyx4LHksY29sb3IpOwogICAgIH0KfQ==
Main.java:3: error: illegal start of type
private:
^
Main.java:3: error: ';' expected
private:
^
Main.java:4: error: <identifier> expected
int x1, x2, y1, y2, algoID;
^
Main.java:6: error: illegal start of type
public :
^
Main.java:6: error: ';' expected
public :
^
Main.java:7: error: illegal start of type
Line()
^
Main.java:7: error: <identifier> expected
Line()
^
Main.java:7: error: ';' expected
Line()
^
Main.java:11: error: class, interface, or enum expected
Line(int algoID,int x1, int x2, int y1, int y2)
^
Main.java:14: error: class, interface, or enum expected
this->x1 = x1 ;
^
Main.java:15: error: class, interface, or enum expected
this->x2 = x2 ;
^
Main.java:16: error: class, interface, or enum expected
this->y1 = y1 ;
^
Main.java:17: error: class, interface, or enum expected
this->y2 = y2 ;
^
Main.java:18: error: class, interface, or enum expected
}
^
Main.java:22: error: class, interface, or enum expected
}
^
Main.java:26: error: class, interface, or enum expected
}
^
Main.java:30: error: class, interface, or enum expected
}
^
Main.java:34: error: class, interface, or enum expected
}
^
Main.java:38: error: class, interface, or enum expected
}
^
Main.java:43: error: illegal start of type
private:
^
Main.java:43: error: ';' expected
private:
^
Main.java:44: error: <identifier> expected
int xc , yc, a, b, algoID ;
^
Main.java:45: error: illegal start of type
public :
^
Main.java:45: error: ';' expected
public :
^
Main.java:46: error: illegal start of type
elipse()
^
Main.java:46: error: <identifier> expected
elipse()
^
Main.java:46: error: ';' expected
elipse()
^
Main.java:50: error: class, interface, or enum expected
elipse(int algoID,int xc, int x, int yc, int y)
^
Main.java:53: error: class, interface, or enum expected
this->xc = xc ;
^
Main.java:54: error: class, interface, or enum expected
this->a = x ;
^
Main.java:55: error: class, interface, or enum expected
this->yc = yc ;
^
Main.java:56: error: class, interface, or enum expected
this->b = y ;
^
Main.java:57: error: class, interface, or enum expected
}
^
Main.java:61: error: class, interface, or enum expected
}
^
Main.java:65: error: class, interface, or enum expected
}
^
Main.java:69: error: class, interface, or enum expected
}
^
Main.java:73: error: class, interface, or enum expected
}
^
Main.java:77: error: class, interface, or enum expected
}
^
Main.java:82: error: illegal start of type
private:
^
Main.java:82: error: ';' expected
private:
^
Main.java:83: error: <identifier> expected
int xc , yc, x, y, algoID ;
^
Main.java:84: error: illegal start of type
public:
^
Main.java:84: error: ';' expected
public:
^
Main.java:85: error: illegal start of type
Circle()
^
Main.java:85: error: <identifier> expected
Circle()
^
Main.java:85: error: ';' expected
Circle()
^
Main.java:89: error: class, interface, or enum expected
Circle(int algoID,int xc, int x, int yc, int y)
^
Main.java:92: error: class, interface, or enum expected
this->xc = xc ;
^
Main.java:93: error: class, interface, or enum expected
this->x = x ;
^
Main.java:94: error: class, interface, or enum expected
this->yc = yc ;
^
Main.java:95: error: class, interface, or enum expected
this->y = y ;
^
Main.java:96: error: class, interface, or enum expected
}
^
Main.java:100: error: class, interface, or enum expected
}
^
Main.java:104: error: class, interface, or enum expected
}
^
Main.java:108: error: class, interface, or enum expected
}
^
Main.java:112: error: class, interface, or enum expected
}
^
Main.java:116: error: class, interface, or enum expected
}
^
Main.java:120: error: class, interface, or enum expected
LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM);
^
Main.java:123: error: class, interface, or enum expected
TCHAR szClassName[ ] = _T("CodeBlocksWindowsApp");
^
Main.java:125: error: class, interface, or enum expected
void swap (int &x1 , int &x2 , int &y1 , int &y2)
^
Main.java:128: error: class, interface, or enum expected
x1 = x2;
^
Main.java:129: error: class, interface, or enum expected
x2 = temp;
^
Main.java:131: error: class, interface, or enum expected
temp = y1;
^
Main.java:132: error: class, interface, or enum expected
y1 = y2;
^
Main.java:133: error: class, interface, or enum expected
y2 = temp;
^
Main.java:134: error: class, interface, or enum expected
}
^
Main.java:138: error: class, interface, or enum expected
SetPixel(hdc , xc - x , yc - y , color);
^
Main.java:139: error: class, interface, or enum expected
SetPixel(hdc , xc + x , yc - y , color);
^
Main.java:140: error: class, interface, or enum expected
SetPixel(hdc , xc - x , yc + y , color);
^
Main.java:142: error: class, interface, or enum expected
}
^
Main.java:147: error: class, interface, or enum expected
SetPixel(hdc , xc - x , yc - y , color);
^
Main.java:148: error: class, interface, or enum expected
SetPixel(hdc , xc + x , yc - y , color);
^
Main.java:149: error: class, interface, or enum expected
SetPixel(hdc , xc - x , yc + y , color);
^
Main.java:150: error: class, interface, or enum expected
SetPixel(hdc , xc + y , yc + x , color);
^
Main.java:151: error: class, interface, or enum expected
SetPixel(hdc , xc - y , yc - x , color);
^
Main.java:152: error: class, interface, or enum expected
SetPixel(hdc , xc - y , yc + x , color);
^
Main.java:153: error: class, interface, or enum expected
SetPixel(hdc , xc + y , yc - x , color);
^
Main.java:154: error: class, interface, or enum expected
}
^
Main.java:158: error: class, interface, or enum expected
COLORREF color=RGB(255,80,0);
^
Main.java:159: error: class, interface, or enum expected
draw4Points(hdc,xc,yc,x,y,color);
^
Main.java:160: error: class, interface, or enum expected
while (x*b*b<=y*a*a)
^
Main.java:163: error: class, interface, or enum expected
y=b*sqrt(1-((x*x)/(a*a)));
^
Main.java:164: error: class, interface, or enum expected
draw4Points(hdc,xc,yc,x,y, color);
^
Main.java:165: error: class, interface, or enum expected
}
^
Main.java:167: error: class, interface, or enum expected
draw4Points(hdc,xc,yc,x,y, color);
^
Main.java:168: error: class, interface, or enum expected
while (y*a*a<=x*b*b)
^
Main.java:171: error: class, interface, or enum expected
x=a*sqrt(1-((y*y)/(b*b)));
^
Main.java:172: error: class, interface, or enum expected
draw4Points(hdc,xc,yc,x,y, color);
^
Main.java:173: error: class, interface, or enum expected
}
^
Main.java:179: error: class, interface, or enum expected
int R = sqrt((double)((x-xc)*(x-xc) + (y-yc)*(y-yc)));
^
Main.java:180: error: class, interface, or enum expected
x = 0 ;
^
Main.java:181: error: class, interface, or enum expected
y = R ;
^
Main.java:182: error: class, interface, or enum expected
int R2 = R*R ;
^
Main.java:183: error: class, interface, or enum expected
draw8Points(hdc, xc , yc , x , y , color);
^
Main.java:184: error: class, interface, or enum expected
while(x < y)
^
Main.java:187: error: class, interface, or enum expected
y = sqrt((double)(R2 - x*x));
^
Main.java:188: error: class, interface, or enum expected
draw8Points(hdc, xc , yc , x , y , color);
^
Main.java:189: error: class, interface, or enum expected
}
^
Main.java:195: error: class, interface, or enum expected
double x = xt , y = yt ;
^
Main.java:196: error: class, interface, or enum expected
double r = sqrt((x-xc)*(x-xc) + (y-yc)*(y-yc));
^
100 errors