Code Competitions

Coding competition

Tuesday, 14 May 2013

program to perform Scaling Transformation of a figure wth respect to fixed point.

#include"z:\headr.h"
#include<iostream.h>
#include<graphics.h>
#include<conio.h>

int v[3][3];
int r[3][3]; 
int d[3][3];
int vd[3][3];
int vt[3][3];
void main()
{
    int gd = DETECT, gm;
    initgraph(&gd, &gm, "");
    vm(v);
    tdsp(v);
    getch();
  // SCALING WITH RESPECT TO A POINT
     setcolor(4);
    trans( - v[0][0],  - v[0][1], vt);
    scale(2,2,r);
    matmul(vt, r, vd);
    matmul(vd, v, d);
    tdsp(d);

    getch();
    closegraph();
 }                             

                        
OUTPUT                     


No comments:

Post a Comment