00001 #ifndef _GEOMETRY_H
00002 #define _GEOMETRY_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #include <math.h>
00030
00031
00032 class Vertex;
00033
00034
00036
00042 namespace geometry
00043 {
00044
00048 typedef struct {
00049 double x;
00050 double y;
00051 } point;
00052
00053
00054
00058 typedef struct {
00059 point p1;
00060 point p2;
00061 } line;
00062
00063
00064
00066
00069 double distance(const point& p1, const point& p2);
00070
00071
00072
00074
00080 double distance(const line& l, const point& p);
00081
00082
00083
00085
00091 double area(Vertex* p1, Vertex* p2, Vertex* p3);
00092
00093
00094
00096
00100 bool intersect(const line& l1, const line& l2);
00101
00102
00103
00104 };
00105
00106
00107 #endif