We are here with you hands in hands to facilitate your learning & don't appreciate the idea of copying or replicating solutions. Read More>>

Looking For Something at vustudents.ning.com? Click Here to Search

www.bit.ly/vucodes

+ Link For Assignments, GDBs & Online Quizzes Solution

www.bit.ly/papersvu

+ Link For Past Papers, Solved MCQs, Short Notes & More


Dear Students! Share your Assignments / GDBs / Quizzes files as you receive in your LMS, So it can be discussed/solved timely. Add Discussion

How to Add New Discussion in Study Group ? Step By Step Guide Click Here.

CS602 Computer Graphics Assignment No 02 Fall 2019 Solution & Discussion

+ How to Follow the New Added Discussions at Your Mail Address?

+ How to Join Subject Study Groups & Get Helping Material?

+ How to become Top Reputation, Angels, Intellectual, Featured Members & Moderators?

+ VU Students Reserves The Right to Delete Your Profile, If?


See Your Saved Posts Timeline

Views: 1897

.

+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

+ Click Here to Search (Looking For something at vustudents.ning.com?)

+ Click Here To Join (Our facebook study Group)

Replies to This Discussion

yar superwebtech ki videos dekho part 1 and 2 or abhi abhi us ne error  remove wali video bnai hai mainly parameters me linkers lekhne hain or sab se pehle 32-bit release version dev ka select karna hai 

is video ke comments me videos link dekho

CS602 ASSIGNMENT 2 SOLUTION FALL 2019 due date: 27 Nov

try karo ho jaye ga aur agar sare steps follow ke baad akhir par phir error aye ga tab ek dafa close kar ke devc++ duabar open karna ho jaye ga

thnks bro jazakallah

$(CPP) $(LINKOBJ) -o $(BIN) $(LIBS) still this error occur. graphic library i have alrdy added . Id return error exist still

add krne k bad bhi error aa rha h.

CS602 Computer Graphics Assignment 2 Solution & Discussion Fall 2019


 


#include <stdio.h>
#include <graphics.h>
#include <stdlib.h>
#include <math.h>
#include <conio.h>

void reset (int h[][2])
{
int val[9][2] = {
{ 50, 50 },{ 75, 50 },{ 75, 75 },{ 100, 75 },
{ 100, 50 },{ 125, 50 },{ 125, 100 },{ 87, 125 },{ 50, 100 }
};
int i;
for (i=0; i<9; i++)
{
h[i][0] = val[i][0]-50;
h[i][1] = val[i][1]-50;
}
}
void draw (int h[][2])
{
int i;
setlinestyle (DOTTED_LINE, 0, 1);
line (320, 0, 320, 480);
line (0, 240, 640, 240);
setlinestyle (SOLID_LINE, 0, 1);
for (i=0; i<8; i++)
line (320+h[i][0], 240-h[i][1], 320+h[i+1][0], 240-h[i+1][1]);
line (320+h[0][0], 240-h[0][1], 320+h[8][0], 240-h[8][1]);
}
void rotate (int h[][2], float angle)
{
int i;
for (i=0; i<9; i++)
{
int xnew, ynew;
xnew = h[i][0] * cos (angle) - h[i][1] * sin (angle);
ynew = h[i][0] * sin (angle) + h[i][1] * cos (angle);
h[i][0] = xnew; h[i][1] = ynew;
}
}
void scale (int h[][2], int sx, int sy)
{
int i;
for (i=0; i<9; i++)
{
h[i][0] *= sx;
h[i][1] *= sy;
}
}
void translate (int h[][2], int dx, int dy)
{
int i;
for (i=0; i<9; i++)
{
h[i][0] += dx;
h[i][1] += dy;
}
}
void reflect (int h[][2], int m, int c)
{
int i;
float angle;

for (i=0; i<9; i++)
h[i][1] -= c;
angle = M_PI/2 - atan (m);
rotate (h, angle);
for (i=0; i<9; i++)
h[i][0] = -h[i][0];
angle = -angle;
rotate (h, angle);
for (i=0; i<9; i++)
h[i][1] += c;
}

void ini()
{
int gd=DETECT,gm;
void initgraph ( int *gd, int *gm, char *bgi);
}
void dini()
{
getch();
closegraph();
}
void main();
{
int h[9][2],sx,sy,x,y,m,c,choice;
do
{
clrscr();
printf("1. Scaling about the origin.\n");
printf("2. Scaling about an arbitrary point.\n");
printf("3. Reflection about the line y = mx + c.\n");
printf("4. Exit\n");
printf("Enter the choice: ");
scanf("%d",&choice);
switch(choice)
{
case 1: printf ("Enter the x- and y-scaling factors: ");
scanf ("%d%d", &sx, &sy);
ini();
reset (h);
draw (h);getch();
scale (h, sx, sy);
cleardevice();
draw (h);
dini();
break;

case 2: printf ("Enter the x- and y-scaling factors: ");
scanf ("%d%d", &sx, &sy);
printf ("Enter the x- and y-coordinates of the point: ");
scanf ("%d%d", &x, &y);
ini();
reset (h);
translate (h, x, y);// Go to arbitrary point
draw(h); getch();//Show its arbitrary position
cleardevice();
translate(h,-x,-y);//Take it back to origin
draw(h);
getch();
cleardevice();
scale (h, sx, sy);//Now Scale it
draw(h);
getch();
translate (h, x, y);//Back to Arbitrary point
cleardevice();

draw (h);
putpixel (320+x, 240-y, WHITE);
dini();
break;

case 3: printf ("Enter the values of m and c: ");
scanf ("%d%d", &m, &c);
ini();
reset (h);
draw (h); getch();
reflect (h, m, c);
cleardevice();
draw (h);
dini();
break;

case 4: exit(0);
}
}while(choice!=4);
}

yarr kisi ka solution hua k ni?

agr hogya hai tw please contact me mera ni hua

ID do apni bna daita hon. idhr hi file uplaod kar don ga zip formate main ap uplaod kar daina

BS140400036 
Please send a complete solution file in zip format at faisalpak14@gmail.com. thank you

I think id wrong hai BS theek likha hai ap ny??? ya BC??

BS140400036 thek ID hai yeh ap solution bna kr send kr do please. 

bro send kr den

RSS

Today Top Members 

© 2020   Created by +M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service

.