I have got this code to work:
typedef model::point<double, 2, cs::spherical_equatorial<degree> > degree_point;
degree_point FlindersSE(-37.0, 144.0);
and this:
quantity<plane_angle> Flinders = 0.375 * radians; //this works 0.375 radians
But I would like to do degrees minutes and seconds & convert to radians then back again.
I have spent a day trying to understand how the boost system works - examples are a bit thin on the ground, so I was wondering if someone could show a quick example?
Thanks in advance 8+)
Edit
//quantity<degree_base_unit> FlindersSDeg2.value(-37.0);
//quantity< angle::arcminute_base_unit> FlindersSMin = 57.0;
//quantity< angle::arcsecond_base_unit> FlindersSSec = 3.72030;
I guess I need a better understanding of how declaration works. :)
Edit2:
Thanks very much - maybe I spent a whole looking for ways to do it with boost & the facility wasn't there ! I thought it might have been because I found this obsolete code here http://www.boost.org/doc/libs/1_47_0/libs/geometry/doc/doxy/doxygen_input/sourcecode/doxygen_1.cpp
void example_dms()
{
/*
Extension, other coordinate system:
// Construction with degree/minute/seconds
boost::geometry::dms<boost::geometry::east> d1(4, 53, 32.5);
// Explicit conversion to double.
std::cout << d1.as_value() << std::endl;
// Conversion to string, with optional strings
std::cout << d1.get_dms(" deg ", " min ", " sec") << std::endl;
// Combination with latitude/longitude and cardinal directions
{
using namespace boost::geometry;
point_ll<double, boost::geometry::cs::geographic<boost::geometry::degree> > canberra(
latitude<>(dms<south>(35, 18, 27)),
longitude<>(dms<east>(149, 7, 27.9)));
std::cout << canberra << std::endl;
}
*/
}