proj home

Files   Classes   Functions   Hierarchy  

halfspaceD2draw.cpp

Go to the documentation of this file.
00001 #include <halfspaceD2draw.h>
00002 
00003 void halfspaceD2draw::draw() 
00004 {
00005   glColor3ub(0,255,0);
00006   glBegin(GL_LINES);
00007   glVertex3f(h.p0.x,h.p0.y,0.0);
00008   glColor3ub(255,0,0);
00009   glVertex3f(h.p1.x,h.p1.y,0.0);
00010   glEnd();
00011 }
00012 
00013 void halfspaceD2draw::rotate(double const theta)
00014 {
00015   pt2 z;
00016   z.x = h.p1.x - h.p0.x;
00017   z.y = h.p1.y - h.p0.y;
00018   double r = z.distance();
00019     
00020   alpha += theta;
00021 //cout << SHOW(alpha) << endl;
00022   z.x = r*cos(alpha);
00023   z.y = r*sin(alpha);
00024   h.p1.x = z.x + h.p0.x;
00025   h.p1.y = z.y + h.p0.y;
00026 
00027   h.normalcalculate();
00028 }
00029 
00030 
00031 
00032 

Generated on Fri Mar 4 00:49:26 2011 for Chelton Evans Source by  doxygen 1.5.8