을 boost_1_48_0 라디안이 다시 돌아옵니다.사용 부스트 내가 일을이 코드를 가지고
나는 부스트 시스템이 어떻게 작동하는지 이해하려고 하루를 보냈다. 예가 약간 얇아서 누군가가 빠른 예를 보여줄 수 있는지 궁금해하고 있었다. 사전에
감사 8+)는
편집
//quantity<degree_base_unit> FlindersSDeg2.value(-37.0);
//quantity< angle::arcminute_base_unit> FlindersSMin = 57.0;
//quantity< angle::arcsecond_base_unit> FlindersSSec = 3.72030;
나는 선언이 어떻게 작동하는지에 대한 이해가 필요합니다 같아요. :)
Edit2가이 :
덕분에 매우 - 어쩌면 내가 시설이 없었다 부스트 &와 함께 할 수있는 방법을 찾고 전체를 보냈다!
double ToDegrees(const Angle & angle)
{
return static_cast<boost::units::quantity<boost::units::degree::plane_angle>>(angle).value();
}
double ToRadians(const Angle & angle)
{
return static_cast<boost::units::quantity<boost::units::si::plane_angle>>(angle).value();
}
이는 형태 보증 공장에 의해 보완된다 : 나는 여기 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;
}
*/
}
안녕하세요 Scott, 빠른 답장을 보내 주셔서 감사합니다. 분과 초를하는 방법에 대한 아이디어? 내가 성공하지 않고 시도한 것을 보여주기 위해 내 게시물을 편집 할 것입니다. – TheIdeasMan
나는 ToDegrees와 double angleInDegrees에서 double return을 3-double, 즉 D, M, S를 포착하기위한 간단한 구조체로 바꾸는 것이 좋습니다. –
좋습니다. 부스트 변수를 초기화하는 방법이 있습니까? 나는 잠깐 C++을 사용 해왔다.하지만 아주 새롭기 때문에 새롭게 등장했다. :) – TheIdeasMan