<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments for Just coding around</title>
	<atom:link href="http://van-uffelen.com/blog/?feed=comments-rss2" rel="self" type="application/rss+xml" />
	<link>http://van-uffelen.com/blog</link>
	<description>My stumbles while coding in various languages</description>
	<lastBuildDate>Thu, 23 May 2013 22:33:24 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
	<item>
		<title>Comment on Exponential slider by admin</title>
		<link>http://van-uffelen.com/blog/?p=291#comment-1165</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Thu, 23 May 2013 22:33:24 +0000</pubDate>
		<guid isPermaLink="false">http://van-uffelen.com/blog/?p=291#comment-1165</guid>
		<description><![CDATA[Yes: if you take

&lt;code&gt;f(0.5) = c&lt;/code&gt;

you can solve the equation

&lt;code&gt;b = (1 - 2 * c)/Math.pow(c, 2)&lt;/code&gt;

which gives

&lt;code&gt;a = Math.log((1 - 2 * c)/Math.pow(c, 2) + 1)&lt;/code&gt;

and the final formula:

&lt;code&gt;(Math.exp(Math.log((1 - 2 * c)/Math.pow(c, 2) + 1) * x) - 1) / ((1 - 2 * c)/Math.pow(c, 2))&lt;/code&gt;

I advise strongly to precalculate a and b for a given c so you can use the simpler and faster formula:

&lt;code&gt;(Math.exp(a * x) - 1) / b&lt;/code&gt;.]]></description>
		<content:encoded><![CDATA[<p>Yes: if you take</p>
<p><code>f(0.5) = c</code></p>
<p>you can solve the equation</p>
<p><code>b = (1 - 2 * c)/Math.pow(c, 2)</code></p>
<p>which gives</p>
<p><code>a = Math.log((1 - 2 * c)/Math.pow(c, 2) + 1)</code></p>
<p>and the final formula:</p>
<p><code>(Math.exp(Math.log((1 - 2 * c)/Math.pow(c, 2) + 1) * x) - 1) / ((1 - 2 * c)/Math.pow(c, 2))</code></p>
<p>I advise strongly to precalculate a and b for a given c so you can use the simpler and faster formula:</p>
<p><code>(Math.exp(a * x) - 1) / b</code>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Exponential slider by Dave</title>
		<link>http://van-uffelen.com/blog/?p=291#comment-1164</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Wed, 22 May 2013 17:17:35 +0000</pubDate>
		<guid isPermaLink="false">http://van-uffelen.com/blog/?p=291#comment-1164</guid>
		<description><![CDATA[is it possible to generalise the equation so that it works for any f(0.5) value between 0 and 1 limits?]]></description>
		<content:encoded><![CDATA[<p>is it possible to generalise the equation so that it works for any f(0.5) value between 0 and 1 limits?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Exponential slider by Bruce Kroeze</title>
		<link>http://van-uffelen.com/blog/?p=291#comment-1086</link>
		<dc:creator>Bruce Kroeze</dc:creator>
		<pubDate>Fri, 08 Mar 2013 18:33:52 +0000</pubDate>
		<guid isPermaLink="false">http://van-uffelen.com/blog/?p=291#comment-1086</guid>
		<description><![CDATA[I wanted to make the log scaling operation reversible.  If you express your initial log operation as so:

log16 = Math.log(16) // same as the magic constant used above

var scaledValue = (Math.exp(log16 * x -1) /15 * MAX_WIDTH);
var unscaledValue =  log16  * (Math.log(scaledValue * 15 /MAX_WIDTH + 1))

unscaledValue then fuzzy-equals x.]]></description>
		<content:encoded><![CDATA[<p>I wanted to make the log scaling operation reversible.  If you express your initial log operation as so:</p>
<p>log16 = Math.log(16) // same as the magic constant used above</p>
<p>var scaledValue = (Math.exp(log16 * x -1) /15 * MAX_WIDTH);<br />
var unscaledValue =  log16  * (Math.log(scaledValue * 15 /MAX_WIDTH + 1))</p>
<p>unscaledValue then fuzzy-equals x.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Exponential slider by Rich</title>
		<link>http://van-uffelen.com/blog/?p=291#comment-1078</link>
		<dc:creator>Rich</dc:creator>
		<pubDate>Thu, 31 Jan 2013 16:13:49 +0000</pubDate>
		<guid isPermaLink="false">http://van-uffelen.com/blog/?p=291#comment-1078</guid>
		<description><![CDATA[NOTE: $x is expected to change along with the value of the slider.]]></description>
		<content:encoded><![CDATA[<p>NOTE: $x is expected to change along with the value of the slider.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Exponential slider by Rich</title>
		<link>http://van-uffelen.com/blog/?p=291#comment-1077</link>
		<dc:creator>Rich</dc:creator>
		<pubDate>Thu, 31 Jan 2013 16:11:24 +0000</pubDate>
		<guid isPermaLink="false">http://van-uffelen.com/blog/?p=291#comment-1077</guid>
		<description><![CDATA[This was incredibly useful in helping me identify how to build an exponential slider. The only difference with mine was that the minimum value was greater than 0, so I had to make a few alterations to your code:

&lt;code&gt;
$x = 1;
$min = 5;
$max = 1000;
print f($x, $min, $max);

function f($x, $min, $max) {
	return ((($max - $min) * (exp($x) - 1) / (exp(1) - 1)) + $min);
}
&lt;/code&gt;]]></description>
		<content:encoded><![CDATA[<p>This was incredibly useful in helping me identify how to build an exponential slider. The only difference with mine was that the minimum value was greater than 0, so I had to make a few alterations to your code:</p>
<p><code><br />
$x = 1;<br />
$min = 5;<br />
$max = 1000;<br />
print f($x, $min, $max);</p>
<p>function f($x, $min, $max) {<br />
	return ((($max - $min) * (exp($x) - 1) / (exp(1) - 1)) + $min);<br />
}<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Exponential slider by admin</title>
		<link>http://van-uffelen.com/blog/?p=291#comment-1070</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Fri, 14 Dec 2012 23:35:26 +0000</pubDate>
		<guid isPermaLink="false">http://van-uffelen.com/blog/?p=291#comment-1070</guid>
		<description><![CDATA[But must it be possible to select for example 1.462.987 or do you only want to select 1,100,200,...10.000,11.000,12.000,...,100.000,110.000,...? Because if that is the case a range test is enough (set the slider range from 0 to 500):

function step2euro(step) {
  if (step &lt; 1) return 1;
  if (step &lt; 101) return step * 100;
  if (step &lt; 201) return (step - 100) * 1000;
  if (step &lt; 301) return (step - 200) * 10000;
  if (step &lt; 401) return (step - 300) * 100000;
  return (step - 400) * 1000000;
}]]></description>
		<content:encoded><![CDATA[<p>But must it be possible to select for example 1.462.987 or do you only want to select 1,100,200,&#8230;10.000,11.000,12.000,&#8230;,100.000,110.000,&#8230;? Because if that is the case a range test is enough (set the slider range from 0 to 500):</p>
<p>function step2euro(step) {<br />
  if (step < 1) return 1;<br />
  if (step < 101) return step * 100;<br />
  if (step < 201) return (step &#8211; 100) * 1000;<br />
  if (step < 301) return (step &#8211; 200) * 10000;<br />
  if (step < 401) return (step &#8211; 300) * 100000;<br />
  return (step &#8211; 400) * 1000000;<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Exponential slider by Yves</title>
		<link>http://van-uffelen.com/blog/?p=291#comment-1069</link>
		<dc:creator>Yves</dc:creator>
		<pubDate>Thu, 06 Dec 2012 13:12:47 +0000</pubDate>
		<guid isPermaLink="false">http://van-uffelen.com/blog/?p=291#comment-1069</guid>
		<description><![CDATA[hi there

is it possible to make a range slider for big values?

for example a price selector:

1 euro to 100 mio euro
1 - 10&#039;000 = hundred steps
10&#039;000 - 100&#039;000 = thousend steps
100&#039;000 - 1 mio = 10k steps
1 mio - 10 mio = 100k steps
10 mio - 100 mio = 1m steps]]></description>
		<content:encoded><![CDATA[<p>hi there</p>
<p>is it possible to make a range slider for big values?</p>
<p>for example a price selector:</p>
<p>1 euro to 100 mio euro<br />
1 &#8211; 10&#8217;000 = hundred steps<br />
10&#8217;000 &#8211; 100&#8217;000 = thousend steps<br />
100&#8217;000 &#8211; 1 mio = 10k steps<br />
1 mio &#8211; 10 mio = 100k steps<br />
10 mio &#8211; 100 mio = 1m steps</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Exponential slider by admin</title>
		<link>http://van-uffelen.com/blog/?p=291#comment-1055</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Fri, 02 Nov 2012 00:41:25 +0000</pubDate>
		<guid isPermaLink="false">http://van-uffelen.com/blog/?p=291#comment-1055</guid>
		<description><![CDATA[Finally got time to post a simple example in JavaScript. Enjoy.]]></description>
		<content:encoded><![CDATA[<p>Finally got time to post a simple example in JavaScript. Enjoy.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Exponential slider by admin</title>
		<link>http://van-uffelen.com/blog/?p=291#comment-1054</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Fri, 02 Nov 2012 00:40:49 +0000</pubDate>
		<guid isPermaLink="false">http://van-uffelen.com/blog/?p=291#comment-1054</guid>
		<description><![CDATA[x is the value of the slider, ranging from 0 to 1.]]></description>
		<content:encoded><![CDATA[<p>x is the value of the slider, ranging from 0 to 1.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Exponential slider by James</title>
		<link>http://van-uffelen.com/blog/?p=291#comment-1053</link>
		<dc:creator>James</dc:creator>
		<pubDate>Wed, 15 Aug 2012 10:51:19 +0000</pubDate>
		<guid isPermaLink="false">http://van-uffelen.com/blog/?p=291#comment-1053</guid>
		<description><![CDATA[Hello,

Couldn&#039;t you please show some live example with this formula in use? thanks!]]></description>
		<content:encoded><![CDATA[<p>Hello,</p>
<p>Couldn&#8217;t you please show some live example with this formula in use? thanks!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
