- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List

# Angle.h

    00001 /**********************************************************************
    00002  * $Id: Angle.h 3363 2011-05-13 16:17:38Z mloskot $
    00003  *
    00004  * GEOS - Geometry Engine Open Source
    00005  * http://geos.refractions.net
    00006  *
    00007  * Copyright (C) 2009-2011  Sandro Santilli <strk@keybit.net>
    00008  *
    00009  * This is free software; you can redistribute and/or modify it under
    00010  * the terms of the GNU Lesser General Public Licence as published
    00011  * by the Free Software Foundation.
    00012  * See the COPYING file for more information.
    00013  *
    00014  **********************************************************************
    00015  *
    00016  * Last port: algorithm/Angle.java r378 (JTS-1.12)
    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> // for constants
    00025
    00026 // Forward declarations
    00027 namespace geos {
    00028         namespace geom {
    00029                 class Coordinate;
    00030         }
    00031 }
    00032
    00033 namespace geos {
    00034 namespace algorithm { // geos::algorithm
    00035
    00037 //
    00040 class GEOS_DLL Angle
    00041 {
    00042 public:
    00043
    00044         static const double PI_TIMES_2; // 2.0 * PI;
    00045         static const double PI_OVER_2; // PI / 2.0;
    00046         static const double PI_OVER_4; // PI / 4.0;
    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 } // namespace geos::algorithm
    00226 } // namespace geos
    00227
    00228
    00229 #endif // GEOS_ALGORITHM_ANGLE_H