GEOS  3.9.1dev
Triangle.h
Go to the documentation of this file.
1 /**********************************************************************
2  *
3  * GEOS - Geometry Engine Open Source
4  * http://geos.osgeo.org
5  *
6  * Copyright (C) 2006 Refractions Research Inc.
7  *
8  * This is free software; you can redistribute and/or modify it under
9  * the terms of the GNU Lesser General Public Licence as published
10  * by the Free Software Foundation.
11  * See the COPYING file for more information.
12  *
13  **********************************************************************/
14 
15 #ifndef GEOS_GEOM_TRIANGLE_H
16 #define GEOS_GEOM_TRIANGLE_H
17 
18 #include <geos/export.h>
19 #include <geos/geom/Coordinate.h>
20 
21 #include <geos/inline.h>
22 
23 namespace geos {
24 namespace geom { // geos::geom
25 
32 public:
33  Coordinate p0, p1, p2;
34 
35  Triangle(const Coordinate& nP0, const Coordinate& nP1, const Coordinate& nP2)
36  :
37  p0(nP0),
38  p1(nP1),
39  p2(nP2)
40  {}
41 
50  void inCentre(Coordinate& resultPoint);
51 
69  void circumcentre(Coordinate& resultPoint);
70  void circumcentreDD(Coordinate& resultPoint);
71 
72  bool isIsoceles();
73 
75  static const Coordinate circumcentre(const Coordinate& p0, const Coordinate& p1, const Coordinate& p2);
76 
77 private:
78 
93  double det(double m00, double m01, double m10, double m11) const;
94 
95 };
96 
97 
98 } // namespace geos::geom
99 } // namespace geos
100 
101 //#ifdef GEOS_INLINE
102 //# include "geos/geom/Triangle.inl"
103 //#endif
104 
105 #endif // ndef GEOS_GEOM_TRIANGLE_H
#define GEOS_DLL
Definition: export.h:28
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:60
Triangle(const Coordinate &nP0, const Coordinate &nP1, const Coordinate &nP2)
Definition: Triangle.h:35
Basic namespace for all GEOS functionalities.
Coordinate p2
Definition: Triangle.h:33
Represents a planar triangle, and provides methods for calculating various properties of triangles...
Definition: Triangle.h:31