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
#include <math.h>
00028
00029
00030
class Vertex;
00031
00032
00034
00040 namespace geometry
00041 {
00042
00046 typedef struct {
00047
double x;
00048
double y;
00049 }
point;
00050
00051
00052
00056 typedef struct {
00057
point p1;
00058
point p2;
00059 }
line;
00060
00061
00062
00068
double distance(
const point& p1,
const point& p2);
00069
00070
00071
00073
00079
double distance(
const line& l,
const point& p);
00080
00081
00082
00084
00090
double area(
Vertex* p1,
Vertex* p2,
Vertex* p3);
00091
00092
00093
00095
00099
bool intersect(
const line& l1,
const line& l2);
00100
00101
00102
00103 };
00104
00105
00106
#endif