Code Competitions

Coding competition

Tuesday, 14 May 2013

To perform Scaling Transformation of a figure w.r.t origin



#include "z:\headr.h"
#include<conio.h>
#include<iostream.h>
#include<graphics.h>
int v[3][3];
int r[3][3];
int s[3][3];
void main()
{
  int gd = DETECT, gm;
  initgraph(&gd, &gm, "");
  vm(v);
  tdsp(v);
  getch();
  // SCALING WITH RESPECT TO ORIGIN
  scale(2, 2, s);
  matmul(v, s, r);
  setcolor(10);
  tdsp(r);

  getch();
  closegraph();
}

OUTPUT:
 

No comments:

Post a Comment