4 #include "SDL/SDL_opengl.h"
7 const double PI
= 3.14159265358979323846;
12 Ponto (double x1
, double y1
) {x
= x1
; y
= y1
;}
15 double distance(const Ponto
&a
,const Ponto
&b
);
17 double operator*(const Ponto
&a
, const Ponto
&b
);
18 Ponto
operator-(const Ponto
&a
, const Ponto
&b
);
19 Ponto
operator+(const Ponto
&a
, const Ponto
&b
);
26 void translate(Ponto v
);
28 Linha(double x1
,double y1
,double x2
, double y2
);
29 Linha(Ponto a
, Ponto b
) {vertices
[0] = a
; vertices
[1] = b
; color
[0] = color
[1] = color
[2] = 0.0; }
37 Rect(double x1
,double y1
,double x2
, double y2
);
38 Rect(Ponto a
, Ponto b
) {vertices
[0] = a
; vertices
[1] = b
; normaliza();}
43 std::vector
<Linha
> linhas
;
44 void addLinha(Linha linha
) {linhas
.push_back(linha
);}
46 void translate(Ponto v
);
49 void drawCircle(double radius
, int lines
);
50 bool linesIntersect(const Linha a
,const Linha b
);
51 double timeToIntersection(const Linha a
,const Linha b
);
53 double sign(double n
);
54 double closerToZero(double a
, double b
);