Talk:Unit conversions

From Opasnet
Jump to navigation Jump to search

Talk about temperature changes -- Gnarssh 13:55, 8 June 2012 (EEST)

Is it possible to convert units of temperature? It seems like the tool only counts coefficents, not additions or both as needed for degrees of Celsius and Fahrenheit. I found the page rather easy to understand, should I write a step-by-step guide somewhere? Timo Ikonen 16:45, 5 June 2012 (EEST)

It only counts coefficients, so temperatures cannot be converted. The guidance could be on the same page. The actual beauty of unit conversion is when it is used as a part of R objects ovariable and oassessment. But write a basic guide first and later on a better guide for these objects. Jouni 23:10, 5 June 2012 (EEST)

It came to my mind that if we accept complex numbers as inputs, then we could use the real number part as coefficient and the imaginary number part as intercept. This would probably only make one line change in the code of convert.units. For a reader of the Opasnet page, it would not be too difficult to understand, and then we could transform any units. -- Except changes in temperature: 0 C change of temperature does not mean 32 F change. A solution to this is to use a specific code for units of temperature change, such as deltaC and deltaF (dC would be natural, but the interpretation is deci-C). Just go ahead and make changes if you can. Jouni 09:31, 6 June 2012 (EEST)

I have no experience in writing R, so it might be a bit difficult to make it work. So the concept would be that everything is the form a+bi where i is the input? Then b would be the coefficent and a would allow converting temperatures. When converting Celsius into Kelvin, a is 273,15+i, b is 1 and i is the input. Timo Ikonen 11:37, 6 June 2012 (EEST)

Maybe someone who knows R (like Teemu Rintala) sees this discussion. My suggestion that the conversion from C to K is 1+273.15i, so the intercept is the imaginary number and the coefficient is 1. For most unit conversions, the format is e.g. in to m 0.0254 with no imaginary part (both have the same zero point). What you can do without R knowledge is to put this discussion to the unit conversions page (or rather its discussion page). Jouni 12:49, 6 June 2012 (EEST)

Talk about the unit table

Does this really need to be setup as a visible table? A more general approach would be to write a library of conversion functions and constants (which can be made fairly easy for the eyes) and use 'include' in the actual code. [User:Teemu R|Teemu R]] 13:52, 5 June 2012 (EEST)

At some point that will make sense. However, I expect that some units will show up that did not think of, such as Bq vs. Sv, or rod as a length unit. So I'd like to offer a user to add their own units in the table. At some point, the list is saturated, and it can be included in a library. The same idea is with the page Opasnet (R library): it will eventually go to a library, but now that we are constantly editing it, it is kept on a page in Opasnet. Jouni 16:48, 6 June 2012 (EEST)

Well, yeah, but what I meant was to start building the library as R code instead of a data table, since it'll allow a whole lot more flexibility and wont necessarily have to look too complicated either. Teemu R 09:24, 7 June 2012 (EEST)