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
Write a C++ program which will draw a triangle havingvertices at (300,210), (340,215) and(320,250). Centre of the triangle liesat (320,240).
Your program should perform the followingtransformations.
1. Translate triangle using translating factor tx = 20 and ty= 30
2. Rotate triangle at centre using angle = π / 2
3. Scale triangle at centre using scaling factor Sx = 3 and Sy= 2
Note:
You have to use Borlandc to run this program asgraphics.h is a borlnadc library. You can download borlandc setupfrom 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 followingcommand in your program according to your installation.
initgraph(&gdriver, &gmode, "c:\\tc\\bgi");
For example:
initgraph(&gdriver, &gmode,"c:\\BorlandC\\bgi");
If your program still not showing output then just concentrateon logic and submit
your assignment. Submit .cpp files only.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
