Main Page | Namespace List | Class List | File List | Namespace Members | Class Members

geometry.h

00001 #ifndef _GEOMETRY_H
00002 #define _GEOMETRY_H
00003 
00004 
00005 /*
00006 
00007     This library is free software; you can redistribute it and/or
00008     modify it under the terms of the GNU Library General Public
00009     License as published by the Free Software Foundation; either
00010     version 2 of the License, or (at your option) any later version.
00011 
00012     This library is distributed in the hope that it will be useful,
00013     but WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015     Library General Public License for more details.
00016 
00017     You should have received a copy of the GNU Library General Public License
00018     along with this library; see the file COPYING.LIB.  If not, write to
00019     the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00020     Boston, MA 02111-1307, USA.
00021 
00022     author  : jh, jochen@ifb.bv.tu-berlin.de
00023     
00024     file    : geometry.h
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

Generated on Tue Mar 23 22:15:01 2004 for VMP by doxygen 1.3.6