You need to devide p1-p2 into 2 intervals. Then map all values below your minimum ( sd ) linear into the first interval , all others in the second.
Something like this:
virtual double xForm(double x, double s1, double s2, double p1, double p2) const
{
const double sd = ...;
const double pd = p1 + 0.1 * ( p2 - p1 ); // 10% of the radius for the inactive part
if ( x <= sd )
return p1 + (pd - p1) / (sd - s1) * (x - s1);
else
return pd + (p2 - pd) / (s2 - sd) * (x - sd);
}
virtual double xForm(double x, double s1, double s2, double p1, double p2) const
{
const double sd = ...;
const double pd = p1 + 0.1 * ( p2 - p1 ); // 10% of the radius for the inactive part
if ( x <= sd )
return p1 + (pd - p1) / (sd - s1) * (x - s1);
else
return pd + (p2 - pd) / (s2 - sd) * (x - sd);
}
To copy to clipboard, switch view to plain text mode
HTH,
Uwe
Bookmarks