Update of /cvsroot/boost-sandbox/boost-sandbox/libs/units/example
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20776/example
Modified Files:
unit_example_10.cpp unit_example_16.cpp
Log Message:
fixes for new angle implementation
Index: unit_example_10.cpp
===================================================================
RCS file: /cvsroot/boost-sandbox/boost-sandbox/libs/units/example/unit_example_10.cpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- unit_example_10.cpp 16 Mar 2007 18:29:52 -0000 1.1.1.1
+++ unit_example_10.cpp 29 Mar 2007 22:41:06 -0000 1.2
@@ -65,8 +65,13 @@
#include <boost/units/quantity.hpp>
#include <boost/units/conversion.hpp>
#include <boost/units/systems/si.hpp>
+#include <boost/units/systems/angles/degrees.hpp>
+#include <boost/units/systems/angles/gradians.hpp>
+#include <boost/units/systems/angles/radians.hpp>
#include <boost/units/systems/trig.hpp>
+#include <boost/units/systems/conversions/convert_degrees_to_radians.hpp>
+
int main(void)
{
using namespace boost::units;
@@ -78,12 +83,16 @@
quantity<angle::gradian> thetag((200.0/6.0)*gradians);
quantity<angle::radian> thetar((3.1415926/6.0)*radians);
//]
+
+ cos(thetad);
+ //quantity<angle::dimensionless_degree> cos_thetad(cos(thetad));
+ /*
/// test cos
{
- quantity< unit<dimensionless_type,angle::degree_system> > cos_thetad(cos(thetad));
- quantity< unit<dimensionless_type,angle::gradian_system> > cos_thetag(cos(thetag));
- quantity< unit<dimensionless_type,angle::radian_system> > cos_thetar(cos(thetar));
+ quantity<angle::dimensionless_degree> cos_thetad(cos(thetad));
+ quantity<angle::dimensionless_gradian> cos_thetag(cos(thetag));
+ quantity<angle::dimensionless_radian> cos_thetar(cos(thetar));
sstream1 << "thetad = " << thetad << std::endl
<< "thetag = " << thetag << std::endl
@@ -100,9 +109,9 @@
/// test sin
{
- quantity< unit<dimensionless_type,angle::degree_system> > sin_thetad(sin(thetad));
- quantity< unit<dimensionless_type,angle::gradian_system> > sin_thetag(sin(thetag));
- quantity< unit<dimensionless_type,angle::radian_system> > sin_thetar(sin(thetar));
+ quantity<angle::dimensionless_degree> sin_thetad(sin(thetad));
+ quantity<angle::dimensionless_gradian> sin_thetag(sin(thetag));
+ quantity<angle::dimensionless_radian> sin_thetar(sin(thetar));
sstream1 << "thetad = " << thetad << std::endl
<< "thetag = " << thetag << std::endl
@@ -119,9 +128,9 @@
/// test tan
{
- quantity< unit<dimensionless_type,angle::degree_system> > tan_thetad(tan(thetad));
- quantity< unit<dimensionless_type,angle::gradian_system> > tan_thetag(tan(thetag));
- quantity< unit<dimensionless_type,angle::radian_system> > tan_thetar(tan(thetar));
+ quantity<angle::dimensionless_degree> tan_thetad(tan(thetad));
+ quantity<angle::dimensionless_gradian> tan_thetag(tan(thetag));
+ quantity<angle::dimensionless_radian> tan_thetar(tan(thetar));
sstream1 << "thetad = " << thetad << std::endl
<< "thetag = " << thetag << std::endl
@@ -135,7 +144,7 @@
<< "std::atan(tan(thetar)) = " << std::atan(tan_thetar) << std::endl
<< std::endl;
}
-
+ */
sstream2 << "thetad = 30 deg" << std::endl;
sstream2 << "thetag = 33.3333 grad" << std::endl;
sstream2 << "thetar = 0.523599 rad" << std::endl;
Index: unit_example_16.cpp
===================================================================
RCS file: /cvsroot/boost-sandbox/boost-sandbox/libs/units/example/unit_example_16.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- unit_example_16.cpp 29 Mar 2007 19:44:05 -0000 1.3
+++ unit_example_16.cpp 29 Mar 2007 22:41:06 -0000 1.4
@@ -73,7 +73,7 @@
// helper for conversions between nautical length and SI length
template<>
struct base_unit_converter<length_tag,nautical::system_tag,SI::system_tag> :
- public trivial_conversion, define_reverse_automatically
+ public trivial_conversion, trivial_inverse_conversion
{
typedef double type;
static type value() { return 1.852e3; }
|