Write a C++ program which will draw a triangle having vertices at(300,210), (340,215) and (320,250). Centre of
No answer yet for this question.
Ask a Tutor
Question:
(340,215) and (320,250). Centre of the triangle lies at(320,240).
Your program should perform the following transformations.
1. Translate triangle using translating factor tx = 20 and ty= 30
2. Rotate triangle at centre using angle = p / 2
3. Scale triangle at centre using scaling factor Sx = 3 andSy = 2
Note:
You can consult handouts of lecture 13 for help. You have to useBorlandc to run this
program as graphics.h is a borlnadc library. You can downloadborlandc setup from
download section of cs602. After installing Borlandc runBC.EXE.
Now Go to Options =>Linker =>Libraries
Press Alt + G
Press Alt +K
It will enable the graphics library. Now change following commandin your program
according to your installation.
initgraph(&gdriver, &gmode, "c:\\tc\\bgi");
For example:
initgraph(&gdriver, &gmode, "c:\\BorlandC\\bgi");
Related Book For
Posted Date: