Your IP : 216.73.216.40


Current Path : /var/www/html/venkat/check3/file/cg2013/pawan/
Upload File :
Current File : /var/www/html/venkat/check3/file/cg2013/pawan/rit2013023.cpp

#include <bits/stdc++.h>// program to just rotate//
using namespace std;
#define PI 3.1415


int main() {

	double ang;
	cin >> ang;

	double val = PI/180;

	double val1 = cos(ang*val); 
	double val2 = sin(ang*val);

	float x[3][3],y[3][3];
	float z[3][3];
	for (int i = 0; i < 3; i++) {

		for (int j =0; j < 3; j++) {

			cin>>x[i][j]>>y[i][j]>>z[i][j];
		}
	}
	for (int i = 0; i < 3; i++) {
		for (int j = 0; j < 3; j++) {
			float p = x[i][j],q = y[i][j];
			x[i][j] = p;
			y[i][j] = (q*val1);
			z[i][j] = (q*val2);
		}
	}
	printf("new coordinates are :\n");
	for (int i = 0; i < 3; i++) {
		cout << "Triangle " << i+1 << endl << endl;
		for (int j = 0; j < 3; j++) {
			cout << x[i][j] << ' ' << y[i][j] << ' ' << z[i][j] <<  endl;
		}
	}
	return 0;
}