Write a C++ program which will draw a triangle having vertices at (300,210), (340,215) and(320,250) . Centre
Question:
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.
College Algebra
ISBN: 978-0134697024
12th edition
Authors: Margaret L. Lial, John Hornsby, David I. Schneider, Callie Daniels