The input is slider range value Ex.(-5 to 5) or (X to Y)
I want the X axis intersection points like this (-5,0) (-2,0)(-0.5,0) (0.5,0) (2,0) (5,0) and consider the Point naming from P1 to P6 from left to right. So the difference(x2-x1) for the P1 and P2 also the P5 and P6 should be same when the slider value in middle, that is 0. Likewise the difference should be D1 > D2 > D3.......D4 < D5 < D6
D1 = (P2x - P1x)
D2 = (P3x - P2x)
........
........
D5 = (P4x - P5x)
D6 = (P5x - P6x)
the difference should be like this
D1 == D6 D2 == D5 .... ....
this result will come when the slider on middle position (Ex) if the range is (-5 to 5), the slider value is 0
Let explain -Ve side:
If the slider comes on negative side which means -5 the difference will be D1 > D2 > D3 >......D5 > D6
If the slider comes on negative side which means -4 the difference will be D1 > D2 > D3 >......D5 > D6
and so on...
Difference between the output of -5 and -4 is D1,D2,D3.... of -5 is greater than D1,D2,D3.... of -4 like wise this will replicate result upto the slider value reaches middle point which means 0
let explain the +Ve side:
If the slider comes on positive side which means +5 the difference will be D1 < D2 < D3 <......D5 < D6
If the slider comes on positive side which means +4 the difference will be D1 < D2 < D3 <......D5 < D6
Difference between the output of +5 and +4 is D1,D2,D3.... of +5 is greater than D1,D2,D3.... of +4 like wise this will replicate result upto the slider value reaches middle point which means 0
Note : slider value will be any number between the range
Please refer the below image of X axis intersection points for slider value range
[Edit by Spektre]
Ok the original problem description has nothing to do with the actual problem. The problem statement is as this: Find out (reverse engineer) position of shelf dividers to match density slider for this page. (click on gradient and use density scrollbar). The scrollbar is symmetrical so start with 0-50%
the rest can be mirrored. I manage to obtain these parameters:
int xi[6][5]=
{
{0,82,145,237,344}, // 0%
{0,100,162,245,348}, // 10%
{0,124,180,254,353}, // 20%
{0,140,198,264,357}, // 30%
{0,153,224,280,365}, // 40%
{0,161,245,294,370} // 50%
};
int Ti[6][4]=
{
{ 82, 63, 92, 107 }, // 0%
{ 100, 62, 83, 103 }, // 10%
{ 124, 56, 74, 99 }, // 20%
{ 140, 58, 66, 93 }, // 30%
{ 153, 71, 56, 85 }, // 40%
{ 161, 84, 49, 76 } // 50%
};
where xi[scrollbar]
is list of approximate shelf divider positions and Ti[scrollbar]
are the shelf sizes (periods) obtained for slider states { 0,10,20,30,40,50 } [%]
if you want more precise positions do ityourself from this screenshot mix:
The brown like V lines are the shelf dividers and the last one is constant due to set shelf width so ignore it. Here extra width for more points to enhance precision:
So the question is how to compute xi
for any scrollbar position and preset shelf total width ?