| Current Path : /var/www/html/venkat/check3/file/cg2013/pawan/ |
| Current File : /var/www/html/venkat/check3/file/cg2013/pawan/IIT2013134_1.cpp |
/*
Name : SP Harish
Roll No : IIT2013134
*************Graphics Lab Test******************
Note:
The graphic output was shown to the TA during lab hours
Only the co-ordinates of the point are printed
*/
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <map>
#include <iostream>
#include <vector>
#include <climits>
#include <complex>
#include <sstream>
#include <utility>
#include <valarray>
#include <string>
#include <queue>
#include <iterator>
#include <cstring>
#include <GL/freeglut.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>
#define f(i, a, n) for (i = a; i < n; i++)
#define fd(i, n, a) for (i = n; i >= a; i--)
#define rep(i,n) f(i,0,n)
#define repd(i,n) f(i, n, 0)
#define pb push_back
#define MOD 1000000007
#define s(x) scanf("%lld", &x); //s(x) is for long long int.
#define si(x) scanf("%d", &x);
#define sf(x) scanf("%f", &x);
#define sd(x) scanf("%lf", &x);
#define ss(x) scanf("%s", x);
#define psp printf(" "); //Print space - psp;
#define pnl printf("\n"); //Print new line - pnl;
#define p(x) printf("%lld", x); //p(x) is for long long int.
#define pn(x) printf("%lld\n", x); //..n(x) is for printing with New Line.
#define ps(x) printf("%lld ", x); //..s(x) is for printing with Space.
#define pi(x) printf("%d", x);
#define pin(x) printf("%d\n", x);
#define pis(x) printf("%d ", x);
#define pf(x) printf("%f", x);
#define pfn(x) printf("%f\n", x);
#define pfs(x) printf("%f ", x);
#define pd(x) printf("%lf", x);
#define pdn(x) printf("%lf\n", x);
#define pds(x) printf("%lf ", x);
using namespace std;
map < float, float > unique;
void project_transform(float xa, float ya, float xb, float yb)
{
float za, zb;
float x1, y1, z1, x2, y2, z2, angle;
angle = M_PI/2 - atan(0.1);
x1 = xa;
y1 = ya * cos(angle);
z1 = ya * sin(angle);
x2 = xb;
y2 = yb * cos(angle);
z2 = yb * sin(angle);
za = z1 + ((float)sqrt(0.0101));
zb = z2 + ((float)sqrt(0.0101));
xa = (xa / za) * 0.01;
ya = (y1 / za) * 0.01;
xb = (xb / zb) * 0.01;
yb = (y2 / zb) * 0.01;
xa *= 1000;
ya *= 1000;
xb *= 1000;
yb *= 1000;
xa += 0.5;
xb += 0.5;
ya += 0.5;
yb += 0.5;
//printf("%0.1f,%0.1f,10.00\n", xa, ya);
//printf("%0.1f,%0.1f,10.00\n", xb, yb);
cout << (int)xa << " " << (int)xb << " " << 10 << endl;
cout << (int)ya << " " << (int)yb << " " << 10 << endl;
}
int main(int argc, char ** argv)
{
project_transform(-0.100, 0.700, -0.100, 0.500);
project_transform(0.100, 0.700, 0.100, 0.500);
project_transform(-0.050, 0.0, -0.050,0.500);
project_transform(-0.150,0.0, -0.500,0.400);
project_transform(-0.500,0.400, -0.100,0.700);
project_transform(-0.050, 0.0, -0.400,0.400);
project_transform(-0.400, 0.400 ,-0.100,0.600);
project_transform(0.050, 0.0, 0.050,0.500);
project_transform(0.150,0.0, 0.500,0.400);
project_transform(0.500,0.400, 0.100,0.700);
project_transform(0.050, 0.0, 0.400,0.400);
project_transform(0.400, 0.400 ,0.100,0.600);
return 0;
}