4 const double PI
= 3.14159265358979323846;
6 Linha::Linha(double x1
,double y1
,double x2
, double y2
) {
13 void Linha::desenha() {
16 glVertex3f(vertices
[0].x
, vertices
[0].y
, 0.0f
); // origin of the line
17 glVertex3f(vertices
[1].x
, vertices
[1].y
, 0.0f
); // origin of the line
21 void drawCircle(double radius
, int lines
)
23 double i2rad
= PI
/(lines
/2.0);
24 glBegin(GL_LINE_LOOP
);
25 for (int i
=0; i
< lines
; i
++) {
26 double degInRad
= i
*i2rad
;
27 glVertex2f(cos(degInRad
)*radius
,sin(degInRad
)*radius
);