Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class algo {
- public:
- float x,y,x1,y1,x2,y2,dx,dy,length;
- algo(float X1,float Y1,float X2,float Y2,float Dx,float Dy,float Length) {
- x1 = X1; x2 = X2; y1 = Y1, y2 = Y2; dx = Dx; dy = Dy; length = Length;
- }
- void drawline();
- };
- void algo::drawline() {
- dx = (x2-x1)/length; dy = (y2-y1)/length; x = x1 + 0.5;
- y = y1 + 0.5;
- int i = 1;
- while(i++<=length) {
- putpixel(x,y,15); x += dx;
- y += dy;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement