Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions Bresenham's Circle Drawing
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,10 @@ void circleBres(int xc, int yc, int r)
}
}

int main()
int main(void)
{
int xc = 50, yc = 50, r2 = 30;
int gd = DETECT, gm;
initgraph(&gd, &gm, "");
circleBres(xc, yc, r);
return 0;
}
}
7 changes: 3 additions & 4 deletions Bresenham's Line Drawing
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ void drawline(int x0, int y0, int x1, int y1)
}
}

int main()
int main(void)
{
int gdriver=DETECT, gmode, error, x0, y0, x1, y1;
initgraph(&gdriver, &gmode, "c:\\turboc3\\bgi");
Expand All @@ -41,6 +41,5 @@ int main()
printf("Enter co-ordinates of second point: ");
scanf("%d%d", &x1, &y1);
drawline(x0, y0, x1, y1);

return 0;
}

}
6 changes: 3 additions & 3 deletions DDA
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ void DDA(int X0, int Y0, int X1, int Y1)
}
}

int main()
int main(void)
{
int gd = DETECT, gm;
initgraph (&gd, &gm, "");

int X0 = 2, Y0 = 2, X1 = 14, Y1 = 16;
DDA(2, 2, 14, 16);
return 0;
}

}
6 changes: 3 additions & 3 deletions Mid-Point Circle Drawing
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ void midPointCircleDraw(int x_centre, int y_centre, int r)
}
}

int main()
int main(void)
{
// To draw a circle of radius 5 centred at (0, 0)
midPointCircleDraw(0, 0, 5);
return 0;
}

}