I have forgotten
my Password

Or login with:

  • Facebookhttp://facebook.com/
  • Googlehttps://www.google.com/accounts/o8/id
  • Yahoohttps://me.yahoo.com
Index » General » Open Forum » Welcome »

New User: wroscoe

wroscoe\′s Photo
10 Dec 07, 5:32PM
(3 replies)
New User: wroscoe
Hello,

I'm new to C and would like to create an smart unit converter that recognizes the units of units.
john\′s Photo
10 Dec 07, 11:20PM
Sounds interesting.

I'd like to develop a unit converter also; only I want to be to convert complex unit types, for example: to

and say to

In other words it would need to understand units raised to a particular power. And also the fractions.

If this what you mean also?
wroscoe\′s Photo
11 Dec 07, 3:02AM
Yeah we're on the same page.

The converter would need to recognize both the base units (m,ft,kg) and how its mathmatical relation to the complex units (like the ones you've shown above). I'd like to base the system on the <a href="http://aurora.rg.iupui.edu/~schadow/units/UCUM/ucum.html">Unified Code for Units of Measure.</a>.

I haven't looked a the converters here because you need to buy a commercial license. Whats with that? And over at the codeproject the unit converter's zip file was corrupted.

Let me know if you have any references for this project.
john\′s Photo
11 Dec 07, 10:09AM
I've not seen any units convertions that do the above.

The codecogs system has a number of base types for common quantities, i.e.
  • distance
  • flow
  • density
  • pressure
  • etc.

They then have a recognize unit system, that merely matches to one of these quantities. Lets see if I can embed there 'calculator' here: <iframe src="http://www.codecogs.com/ic-269&u=6" frameborder="0" scrolling="no" width="235" height="193"></iframe>

I've got the source code, which seems good; but doesn't go as far as we need.

--- Not sure how best to proceed. But from what I've read in the past (can't find the references now), we need to express every base unit (perhaps all those that CodeCogs has listed as a start) in its raw universal type of (length, mass, time), which in SI is (m,kg,s). You also work out in advance the conversion factor that takes it into SI (again CodeCogs I think have done this).

Then given a new type, you run through each unit and covert it into one of the base units, keeping a tab of the overall conversion factor. Do this twice for both the initial and target units and you should have the complete conversion.

However, I would also like to be able match these powers of (m,kg,s), back to the more common quantities, so if the system converts say psi into N/m^2=kg/(m s^2), then it can list out Pascals as being of a same type. In addition it would be nice to do error checking, making sure that two types are equivalent.

For this reason we'd need to be able to simplify the base types, however I don't think that should be too complicated.
Currently you need to be logged in to leave a message.