| Current Path : /var/www/html/venkat/check3/file/cg2013/pawan/ |
| Current File : /var/www/html/venkat/check3/file/cg2013/pawan/iit2013142.cpp |
#include <bits/stdc++.h>
#include <cmath>
#include <GL/freeglut.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>
using namespace std;
vector < int > a;
/*void draw_line(float xa, float ya, float xb, float yb)
{
float xIncrement, yIncrement, x, y;
int i;
dx = xb-xa;
dy = yb-ya;
x = xa;
y = ya;
xIncrement = dx / 10000.0;
yIncrement = dy / 10000.0;
for (i = 0; i < 10000; i++) {
x += xIncrement;
y += yIncrement;
glVertex3f((x * 10) / zer, (y * 10 * cos(num)) / zer, 1);
}
}*/
void transfer(float xa, float ya) {
float y1, z1, za, theta;
theta = M_PI/2 - atan(0.1);
sort(a.begin(), a.end());
y1 = ya * cos(theta);
sort(a.rbegin(), a.rend());
z1 = ya * sin(theta);
sort(a.begin(), a.end());
//x2 = xb;
//y2 = yb * cos(theta);
//z2 = yb * sin(theta);
sort(a.rbegin(), a.rend());
za = z1 + sqrt(10100);
sort(a.begin(), a.end());
//zb = z2 + sqrt(10100);
sort(a.rbegin(), a.rend());
xa = (xa / za) * 10;
sort(a.begin(), a.end());
ya = (y1 / za) * 10;
cout << int((xa * 1000)+0.5) << "," << int((ya * 1000)+0.5) <<","<< 10 <<endl;
//cout << int((xb * 1000)+0.5) << "," << int((yb * 1000)+0.5) <<","<< 10 <<endl;
/*cout << int((((xa / ((ya * sin(1.57 - atan(0.1))) + sqrt(10100))) * 10) * 1000)+0.5);
cout << "," << int((((ya * cos(1.57 - atan(0.1))) / ((ya * sin(1.57 - atan(0.1))) + sqrt(10100))) * 10) + 0.5);
cout <<"," << 10 << endl;*/
}
float x[] = {-0.1, -0.1, 0.1, 0.1, -0.1, 0.1, -0.1, 0.1, -0.05, -0.05, -0.15, -0.5, -0.5, -0.1, -0.05, -0.4, 0.05, 0.05, 0.15, 0.5, 0.5, 0.1,
0.05, 0.4, 0.4, 0.1};
float y[] = {0.7, 0.5, 0.7, 0.5, 0.7, 0.7, 0.5, 0.5, 0, 0.5, 0, 0.4, 0.4, 0.7, 0, 0.4, 0.4, 0.6, 0, 0.5, 0, 0.4, 0.4, 0.7, 0, 0.4, 0.4, 0.6};
/*void func() {
float k = 13.0;
//glOrtho(k, -k, k, -k, k, -k);
glClearColor(0, 0, 0, 0);
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1, 1, 1);
glBegin(GL_POINTS);
draw_line(-0.1, 0.7, -0.1, 0.5);
draw_line(0.1, 0.7, 0.1, 0.5);
draw_line(-0.1, 0.7, 0.1, 0.7);
draw_line(-0.1, 0.5, 0.1, 0.5);
draw_line(-0.05, 0, -0.05, 0.5);
draw_line(-0.15, 0, -0.5, 0.4);
draw_line(-0.5, 0.4, -0.1, 0.7);
draw_line(-0.05, 0, -0.4, 0.4);
draw_line(-0.4, 0.4, -0.1, 0.6);
draw_line(0.05, 0, 0.05, 0.5);
draw_line(0.15, 0, 0.5, 0.4);
draw_line(0.5, 0.4, 0.1, 0.7);
draw_line(0.05, 0, 0.4, 0.4);
draw_line(0.4, 0.4, 0.1, 0.6);
glEnd();
glFlush();
}*/
int main(int argc, char ** argv)
{
/*glutInit(&argc, argv);
glutInitDisplayMode(GLUT_SINGLE);
glutInitWindowSize(500, 500);
glutInitWindowPosition(50, 50);
glutCreateWindow("line draw");
glutDisplayFunc(func);
glutMainLoop();*/
for (int i = 0; i < 10; i++) a.push_back(10 - i + 1);
int i = 0;
while (i < 28) {
transfer(x[i], y[i]);
i++;
}
return 0;
}