diff --git a/HilbertCurve.cpp~ b/HilbertCurve.cpp~ deleted file mode 100644 index 9a78a4e..0000000 --- a/HilbertCurve.cpp~ +++ /dev/null @@ -1,67 +0,0 @@ -#include -#include -#include -#include -#include -using namespace std; - -void move(int j, int h, int &x, int &y) -{ - if(j == 1) - { - y = y - h; - } - else if(j == 2) - { - x = x + h; - } - else if(j == 3) - { - y = y + h; - } - else if(j == 4) - { - x = x - h; - } - setcolor(BROWN); - lineto(x,y); -} - -void hilbert(int d, int r, int u, int l, int i, int h, int &x, int &y) -{ - if(i > 0) - { - i--; - hilbert(r,d,l,u,i,h,x,y); - move(d,h,x,y); - hilbert(d,r,u,l,i,h,x,y); - move(r,h,x,y); - hilbert(d,r,u,l,i,h,x,y); - move(u,h,x,y); - hilbert(l,u,r,d,i,h,x,y); - } -} - -int main() -{ - int gd = DETECT,gm; - initgraph(&gd,&gm,NULL); - int x,y,h,n,u = 1,r = 2,d = 3,l = 4; - cout<<"Enter x-co-ordinate of initial point: "; - cin>>x; - - cout<<"Enter y-co-ordinate of initial point: "; - cin>>y; - - cout<<"Enter length of line segment: "; - cin>>h; - - cout<<"Enter order of curve: "; - cin>>n; - - moveto(x,y); - hilbert(d,r,u,l,n,h,x,y); - getch(); - closegraph(); - return 0; -} diff --git a/README.md~ b/README.md~ deleted file mode 100644 index a6431fb..0000000 --- a/README.md~ +++ /dev/null @@ -1,39 +0,0 @@ -# CG - -This repository contains notes and codes for **Computer Graphics.** - ---- - -## Index - -### Codes -#### Digital Differential Analyzer (DDA) -> Digital Differential Analyzer (DDA) is a line-drawing algorithm for digital displays, using incremental calculations to plot points between endpoints. - -1. [Line](https://git.kska.io/sppu-se-comp-codes/CG/src/branch/main/DDA-line.cpp) -2. [Triangle](https://git.kska.io/sppu-se-comp-codes/CG/src/branch/main/DDA-triangle.cpp) -3. [Circle](https://git.kska.io/sppu-se-comp-codes/CG/src/branch/main/DDA-circle.cpp) - -#### Cohen-Sutherland - -1. [Cohen-Sutherland (Using Inbuilt Functions)](https://git.kska.io/sppu-se-comp-codes/CG/src/branch/main/CohenSutherland.cpp) -2. [Cohen-Sutherland (Using DDA Line Drawing Algorithm)](https://git.kska.io/sppu-se-comp-codes/CG/src/branch/main/CohenSutherland%28UsingDDA%29.cpp) - -#### Curves - -1. [Hilbert's Curve](https://git.kska.io/sppu-se-comp-codes/CG/src/branch/main/HilbertCurve.cpp) - -### Notes -1. [Unit 1 - Graphics Primitives and Scan Conversion Algorithms](https://git.kska.io/sppu-se-comp-codes/CG/src/branch/main/notes/Unit%201) -2. [Unit 2 - Polygon, Windowing and Clipping](https://git.kska.io/sppu-se-comp-codes/CG/src/branch/main/notes/Unit%202) -3. [Unit 3 - 2D, 3D Transformations and Projections](https://git.kska.io/sppu-se-comp-codes/CG/src/branch/main/notes/Unit%203) - -### Question Papers -1. [IN-SEM](https://git.kska.io/sppu-se-comp-codes/CG/src/branch/main/question-papers/IN-SEM) -2. [END-SEM](https://git.kska.io/sppu-se-comp-codes/CG/src/branch/main/question-papers/END-SEM) - -### [Lab Manual](https://git.kska.io/sppu-se-comp-codes/CG/src/branch/main/lab-manual/CGL%20Lab%20Manual.pdf) ---- - -Maintained by [notkshitij](https://git.kska.io/notkshitij) and [TanmaySpamzzz](https://git.kska.io/TanmaySpamzzz) -Contributor: [Kalaskar_admin03](https://git.kska.io/Kalaskar_admin03/)