Poco::Geo

class Angle

File Information

Library: Geo
Package: Geo
Header: Poco/Geo/Angle.h

Description

This class represents a geometric angle.

Based on code from the Angle (gov.nasa.worldwind.geom.Angle) class from the NASA World Wind Java source code released under the NOSA license.

Note: when comparing Angles for equality, the usual issues when comparing floating-point numbers should be considered.

Member Summary

Member Functions: angularDistanceTo, compassDirection, compassDirectionFromDegrees, cos, degrees, fromDegrees, fromDegreesLatitude, fromDegreesLongitude, fromRadians, fromRadiansLatitude, fromRadiansLongitude, fromXY, normalized, normalizedDegrees, normalizedDegreesLatitude, normalizedDegreesLongitude, normalizedLatitude, normalizedLongitude, operator !=, operator *, operator +, operator -, operator /, operator <, operator <=, operator =, operator ==, operator >, operator >=, radians, sin, swap

Constructors

Angle

Angle();

Creates a zero Angle.

Angle

Angle(
    const Angle & angle
);

Creates an Angle by copying another one.

Angle protected

Angle(
    double deg,
    double rad
);

Creates an Angle.

Destructor

~Angle

~Angle();

Destroys the Angle.

Member Functions

angularDistanceTo

Angle angularDistanceTo(
    const Angle & angle
) const;

Returns the shortest distance between this and the given Angle.

compassDirection

const std::string & compassDirection() const;

Returns the corresponding compass direction (N, NNW, NW, etc.) for the Angle.

compassDirectionFromDegrees static

static const std::string & compassDirectionFromDegrees(
    double degrees
);

Returns the corresponding compass direction (N, NNW, NW, etc.) for the given angle.

cos

double cos() const;

Returns the cosine of this Angle.

degrees inline

double degrees() const;

Returns the Angle expressed in degrees.

fromDegrees static inline

static Angle fromDegrees(
    double deg
);

Creates an Angle from a number of degrees.

fromDegreesLatitude static

static Angle fromDegreesLatitude(
    double degrees
);

Creates an Angle from a latitude in degrees.

The latitude must be in the interval [-90, 90].

fromDegreesLongitude static

static Angle fromDegreesLongitude(
    double degrees
);

Creates an Angle from a longitude in degrees.

The latitude must be in the interval [-180, 180].

fromRadians static inline

static Angle fromRadians(
    double rad
);

Creates an Angle from a number of radians.

fromRadiansLatitude static

static Angle fromRadiansLatitude(
    double radians
);

Creates an Angle from a latitude in radians.

The latitude must be in the interval [-PI/2, PI/2].

fromRadiansLongitude static

static Angle fromRadiansLongitude(
    double radians
);

Creates an Angle from a longitude in radians.

The latitude must be in the interval [-PI, PI].

fromXY static

static Angle fromXY(
    double x,
    double y
);

Creates an Angle from rectangular coordinates.

  • x is the abscissa coordinate
  • y is the ordinate coordinate

normalized

Angle normalized() const;

Returns a normalized Angle.

normalizedDegrees static

static double normalizedDegrees(
    double degrees
);

Normalizes the given angle in degrees to the interval [0, 360) and returns the result.

normalizedDegreesLatitude static

static double normalizedDegreesLatitude(
    double degrees
);

Normalizes the given angle in degrees to a latitude in the interval [-90, 90] and returns the result.

normalizedDegreesLongitude static

static double normalizedDegreesLongitude(
    double degrees
);

Normalizes the given angle in degrees to a longitude in the interval [-180, 180] and returns the result.

normalizedLatitude

Angle normalizedLatitude() const;

Returns a normalized latitudinal Angle.

normalizedLongitude

Angle normalizedLongitude() const;

Returns a normalized longitudinal Angle.

operator != inline

bool operator != (
    const Angle & angle
) const;

operator * inline

Angle operator * (
    double multiplier
) const;

Multiplies the Angle by the given multiplier and returns the result.

operator + inline

Angle operator + (
    const Angle & angle
) const;

Adds another Angle and returns the result.

operator - inline

Angle operator - (
    const Angle & angle
) const;

Subtracts another Angle and returns the result.

operator / inline

Angle operator / (
    double divisor
) const;

Divides the Angle by the given divisor and returns the result.

operator /

double operator / (
    const Angle & angle
) const;

Divices the Angle by the given angle and returns the result.

operator < inline

bool operator < (
    const Angle & angle
) const;

operator <= inline

bool operator <= (
    const Angle & angle
) const;

operator =

Angle & operator = (
    const Angle & angle
);

Assignment operator.

operator == inline

bool operator == (
    const Angle & angle
) const;

operator > inline

bool operator > (
    const Angle & angle
) const;

operator >= inline

bool operator >= (
    const Angle & angle
) const;

radians inline

double radians() const;

Returns the Angle expressed in radians.

sin

double sin() const;

Returns the sine of this Angle.

swap

void swap(
    Angle & other
);

Swaps the Angle with another one.

Variables

COMPASS_E static

static const std::string COMPASS_E;

COMPASS_ENE static

static const std::string COMPASS_ENE;

COMPASS_ESE static

static const std::string COMPASS_ESE;

COMPASS_N static

static const std::string COMPASS_N;

COMPASS_NE static

static const std::string COMPASS_NE;

COMPASS_NNE static

static const std::string COMPASS_NNE;

COMPASS_NNW static

static const std::string COMPASS_NNW;

COMPASS_NW static

static const std::string COMPASS_NW;

COMPASS_S static

static const std::string COMPASS_S;

COMPASS_SE static

static const std::string COMPASS_SE;

COMPASS_SSE static

static const std::string COMPASS_SSE;

COMPASS_SSW static

static const std::string COMPASS_SSW;

COMPASS_SW static

static const std::string COMPASS_SW;

COMPASS_W static

static const std::string COMPASS_W;

COMPASS_WNW static

static const std::string COMPASS_WNW;

COMPASS_WSW static

static const std::string COMPASS_WSW;

DEGREES_TO_RADIANS static

static const double DEGREES_TO_RADIANS;

NEG180 static

static const Angle NEG180;

An Angle of negative 180 degrees.

NEG90 static

static const Angle NEG90;

An Angle of negative 90 degrees.

PI static

static const double PI;

PI_OVER_2 static

static const double PI_OVER_2;

POS180 static

static const Angle POS180;

An Angle of positive 180 degrees.

POS360 static

static const Angle POS360;

An Angle of positive 360 degrees.

POS90 static

static const Angle POS90;

An Angle of positive 90 degrees.

RADIANS_TO_DEGREES static

static const double RADIANS_TO_DEGREES;

ZERO static

static const Angle ZERO;

An Angle of zero degrees.

Securely control IoT edge devices from anywhere   Connect a Device