Boost logo

Boost :

From: Steven Watanabe (steven_at_[hidden])
Date: 2007-03-31 18:04:37


Matthias Schabel <boost <at>> writes:

> >
> > You're misusing dimensionless_quantity....
> Not sure what you mean - I need to preserve system information in
> dimensionless quantities to make the trig functions properly
> invertible : that is acos(cos(theta)) == theta should hold true...

/// cos of theta in radians
template<class Y>
typename dimensionless_quantity<*angle::radian*,Y>::type
cos(const quantity<angle::radian,Y>& theta)
    return std::cos(theta.value());

/// utility class to simplify construction of dimensionless quantities
template<*class System*,class Y>
struct dimensionless_quantity
    typedef quantity<typename dimensionless_unit<System>::type,Y> type;

In Christ,
Steven Watanabe

Boost list run by bdawes at, gregod at, cpdaniel at, john at