| Home | Libraries | People | FAQ | More

#### degree

Unit of plane angle: Degrees.

###### Description

Tag defining the unit of plane angle for spherical coordinate systems. This tag specifies that coordinates are defined in degrees (-180 .. 180). It has to be specified for some coordinate systems.

###### Synopsis

    struct degree
    {
      // ...
    };

###### Header

Either

`#include <boost/geometry.hpp>`

Or

`#include <boost/geometry/core/cs.hpp>`

###### example

Specify two coordinate systems, one in degrees, one in radians.

    #include <iostream>
    #include <boost/geometry.hpp>

    using namespace boost::geometry;

    int main()
    {
        using degree_point = model::point<double, 2, cs::spherical_equatorial<degree>>;
        using radian_point = model::point<double, 2, cs::spherical_equatorial<radian>>;

        degree_point d(4.893, 52.373);
        radian_point r(0.041, 0.8527);

        double dist = distance(d, r);
        std::cout
            << "distance:" << std::endl
            << dist << " over unit sphere" << std::endl
            << dist * 3959  << " over a spherical earth, in miles" << std::endl;

        return 0;
    }

Output:

    distance:
    0.0675272 over unit sphere
    267.34 over a spherical earth, in miles