Question: Write a C++ program which will draw a triangle having vertices at(300,210), (340,215) and (320,250). Centre of the triangle lies at(320,240). Your program should perform

Write a C++ program which will draw a triangle having vertices at(300,210),
(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");

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!