Code Competitions

Coding competition
Showing posts with label Rotation Transformation w.r.t. Origin.. Show all posts
Showing posts with label Rotation Transformation w.r.t. Origin.. Show all posts

Tuesday, 14 May 2013

To perform Rotation Transformation on a figure w.r.t. Origin.



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

int v[3][3];
int r[3][3];
float rt[3][3];

void main()
{
  int gd = DETECT, gm;
  initgraph(&gd, &gm, "");
  vm(v);
  tdsp(v);
  getch();
  // ROTATION WITH RESPECT TO ORIGIN
  setcolor(10);
  rotate(30,rt);
  matmul(v, rt, r);
  tdsp(r);

  getch();
  closegraph();
}                    
 OUTPUT: