00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef GEOS_ALGORITHM_ANGLE_H
00021 #define GEOS_ALGORITHM_ANGLE_H
00022
00023 #include <geos/export.h>
00024 #include <geos/algorithm/CGAlgorithms.h>
00025
00026
00027 namespace geos {
00028 namespace geom {
00029 class Coordinate;
00030 }
00031 }
00032
00033 namespace geos {
00034 namespace algorithm {
00035
00037
00040 class GEOS_DLL Angle
00041 {
00042 public:
00043
00044 static const double PI_TIMES_2;
00045 static const double PI_OVER_2;
00046 static const double PI_OVER_4;
00047
00049 static const int COUNTERCLOCKWISE = CGAlgorithms::COUNTERCLOCKWISE;
00050
00052 static const int CLOCKWISE = CGAlgorithms::CLOCKWISE;
00053
00055 static const int NONE = CGAlgorithms::COLLINEAR;
00056
00058
00062 static double toDegrees(double radians);
00063
00065
00069 static double toRadians(double angleDegrees);
00070
00074
00080 static double angle(const geom::Coordinate& p0,
00081 const geom::Coordinate& p1);
00082
00086
00092 static double angle(const geom::Coordinate& p);
00093
00095
00105 static bool isAcute(const geom::Coordinate& p0,
00106 const geom::Coordinate& p1,
00107 const geom::Coordinate& p2);
00108
00110
00120 static bool isObtuse(const geom::Coordinate& p0,
00121 const geom::Coordinate& p1,
00122 const geom::Coordinate& p2);
00123
00125
00133 static double angleBetween(const geom::Coordinate& tip1,
00134 const geom::Coordinate& tail,
00135 const geom::Coordinate& tip2);
00136
00138
00149 static double angleBetweenOriented(const geom::Coordinate& tip1,
00150 const geom::Coordinate& tail,
00151 const geom::Coordinate& tip2);
00152
00154
00166 static double interiorAngle(const geom::Coordinate& p0,
00167 const geom::Coordinate& p1,
00168 const geom::Coordinate& p2);
00169
00179 static int getTurn(double ang1, double ang2);
00180
00188 static double normalize(double angle);
00189
00208 static double normalizePositive(double angle);
00209
00210
00212
00221 static double diff(double ang1, double ang2);
00222 };
00223
00224
00225 }
00226 }
00227
00228
00229 #endif // GEOS_ALGORITHM_ANGLE_H