Prev: error line source code
Next: Resolved: Re: Slider math
From: Helmut Meukel on 19 Feb 2010 14:02 Hermann, right, double logarithmic means something else: http://de.wikipedia.org/wiki/Doppelt-logarithmische_Auftragung Right now I don't have any idea, but to find an anwer I have do go back in time to my highschool math, more than 40 years. I never needed logarithms later in my life. <bg> Maybe I come up with something after a good nights sleep. Helmut. "hermann leinen" <h.leinen(a)gmx.de> schrieb im Newsbeitrag news:uXW1tfYsKHA.3908(a)TK2MSFTNGP05.phx.gbl... > Helmut, do you have any idea how I can make it so that the smaller values take > up more space in the slider? > > Right now it is so that when the slider is at the middle position, I am at the > "real" value "71". > I am thinking about a way how to make it let's say "30" only when I'm in the > middle position. > I have no idea which alogrithm I should use. > I think "double logarithmic" means something else, right? > > Greetings > Hermann > > > Am 19.02.2010 13:48, schrieb Helmut Meukel: >> >> "MikeD" <nobody(a)nowhere.edu> schrieb im Newsbeitrag >> news:epYiytVsKHA.5940(a)TK2MSFTNGP02.phx.gbl... >>> >>> >>> "hermann leinen" <h.leinen(a)gmx.de> wrote in message >>> news:u#YVGSUsKHA.4752(a)TK2MSFTNGP04.phx.gbl... >>>> I have a slider that should accept values from 5 to 5000. >>>> Since this cannot really be done by .Min and .Max, I have made it so >>>> that the slider values are internally converted into a logarithmic >>>> scale like this: >>>> >>>> This works great: When the slider is in the middle, it tells me that >>>> value is 71, that is exactely what I wanted. >>> >>> What do you mean it can't be done? How is a value of 71 in the middle >>> of a range that's 5 - 5000 (or even 1000 as you used for Max in your >>> code)? >>> >>> Are you using the Slider from Windows Common Controls? It's Min and >>> Max (and other related properties) are Long data types. This code >>> works fine: >>> >>> Slider1.Min = 0 >>> Slider1.Max = 100000 >>> Slider1.Value = 50000 >>> >>> >>> -- >>> Mike >>> >> >> Mike, >> >> his scale is logarithmic, like the Richter scale for earthquakes. >> The force of an earthquake with 5.0 is 10 times that of an earthquake >> with 4.0 >> >> If in his case the actual values are from 5 to 5000, you could simply >> scale from 0 to 3: >> 5 = 5 * 10^0 ==> 0 >> 50 = 5 * 10^1 ==> 1 >> 500 = 5 * 10^2 ==> 2 >> 5000 = 5 * 10^3 ==> 3 >> Or use an offset to make it more complicated, as he does. >> >> On a logarithmic scale, doubling the real value shows always an increase >> of the >> scale value of about 0.3. >> With an linear scale as you suggested, you will see no change of the >> slider position >> if the value doubled from 50 to 100. >> >> Helmut. >> >> >> >
From: hermann leinen on 19 Feb 2010 14:30
Hi Helmut, thank you for thinking with me, but I think it's not necessary anymore... I have hardcoded this ugly thing now because it doesn't have to be dynamic. Greetings, Hermann Am 19.02.2010 20:02, schrieb Helmut Meukel: > Hermann, > > right, double logarithmic means something else: > http://de.wikipedia.org/wiki/Doppelt-logarithmische_Auftragung > > Right now I don't have any idea, but to find an anwer I have do go > back in time to my highschool math, more than 40 years. I never > needed logarithms later in my life. <bg> > Maybe I come up with something after a good nights sleep. > > Helmut. > > "hermann leinen" <h.leinen(a)gmx.de> schrieb im Newsbeitrag > news:uXW1tfYsKHA.3908(a)TK2MSFTNGP05.phx.gbl... >> Helmut, do you have any idea how I can make it so that the smaller >> values take up more space in the slider? >> >> Right now it is so that when the slider is at the middle position, I >> am at the "real" value "71". >> I am thinking about a way how to make it let's say "30" only when I'm >> in the middle position. >> I have no idea which alogrithm I should use. >> I think "double logarithmic" means something else, right? >> >> Greetings >> Hermann >> >> >> Am 19.02.2010 13:48, schrieb Helmut Meukel: >>> >>> "MikeD" <nobody(a)nowhere.edu> schrieb im Newsbeitrag >>> news:epYiytVsKHA.5940(a)TK2MSFTNGP02.phx.gbl... >>>> >>>> >>>> "hermann leinen" <h.leinen(a)gmx.de> wrote in message >>>> news:u#YVGSUsKHA.4752(a)TK2MSFTNGP04.phx.gbl... >>>>> I have a slider that should accept values from 5 to 5000. >>>>> Since this cannot really be done by .Min and .Max, I have made it so >>>>> that the slider values are internally converted into a logarithmic >>>>> scale like this: >>>>> >>>>> This works great: When the slider is in the middle, it tells me that >>>>> value is 71, that is exactely what I wanted. >>>> >>>> What do you mean it can't be done? How is a value of 71 in the middle >>>> of a range that's 5 - 5000 (or even 1000 as you used for Max in your >>>> code)? >>>> >>>> Are you using the Slider from Windows Common Controls? It's Min and >>>> Max (and other related properties) are Long data types. This code >>>> works fine: >>>> >>>> Slider1.Min = 0 >>>> Slider1.Max = 100000 >>>> Slider1.Value = 50000 >>>> >>>> >>>> -- >>>> Mike >>>> >>> >>> Mike, >>> >>> his scale is logarithmic, like the Richter scale for earthquakes. >>> The force of an earthquake with 5.0 is 10 times that of an earthquake >>> with 4.0 >>> >>> If in his case the actual values are from 5 to 5000, you could simply >>> scale from 0 to 3: >>> 5 = 5 * 10^0 ==> 0 >>> 50 = 5 * 10^1 ==> 1 >>> 500 = 5 * 10^2 ==> 2 >>> 5000 = 5 * 10^3 ==> 3 >>> Or use an offset to make it more complicated, as he does. >>> >>> On a logarithmic scale, doubling the real value shows always an increase >>> of the >>> scale value of about 0.3. >>> With an linear scale as you suggested, you will see no change of the >>> slider position >>> if the value doubled from 50 to 100. >>> >>> Helmut. >>> >>> >>> >> > |