nourani / ScientificQuantities

A C++11 template class to deal with units inside the program
BSD 3-Clause "New" or "Revised" License
11 stars 2 forks source link

Quantities with similar units #1

Open nourani opened 10 years ago

nourani commented 10 years ago

Some of the Derived units have either no Base units or have the same units. These include:

angle (radian) = m/m solid angle (steradian) = m2/m2 Luminous Flux (lumen) = cd; same as Luminous Radioactivity (becquerel) = s-1; same as Frequency

The way we currently implement the template class we cannot differentiate between m, m/m, m2/m2 etc

Don't know what is the best way to deal with this. Maybe we need to include another variable to be used to keep track of these. I was thinking of using a "string literal" but didn't figure out how to implement this.

crayzeewulf commented 10 years ago

It might be worth learning from the way Boost.Units handles this.

nourani commented 10 years ago

Hhhmm I don't know if expanding the set of base dimensions is the "correct" way of doing this, although it is a solution. Isn't there really a standard for this? Need to look into this again

crayzeewulf commented 9 years ago

I agree that it does not seem like a very elegant solution but I have not come across any good way of doing this either (especially if we want to minimize the runtime overhead of using this class).