This question does not appear to be about programming within the scope defined in the help center.
Closed 9 years ago.
您正在寻找一个函数 f ,这样:
f(x) = ax +b f(1)=20 f(100)=80
然后
a+b=20 100a+b=80
您得到:
99a +20 = 80
then a =60/99=20/33 and b = 20 - 20/33 = 20*(32/33)
看一下这个问题以获取更多信息:
反转并转换滑块值
注意:如果 50 缩放为40 你的转变不是线性的。所以你需要寻找另一种类型的函数:
f(x) = ax**2 + bx + c
You're looking for a function f such that :
Then
You get :
Have a look at this question for more information :
Invert and convert slider value
Note: if 50 scales to 40 your transformation is not linear. So you need to look for another type of function:
f(x) = ax**2 + b x + c
您需要更具体地说明您要寻找的内容。您给出的规则不会产生一致的线性缩放。
例如,如果它是线性的:
(1, 20) is on the line (100, 80) is one the line
斜率是:
(80 - 20) / (100 - 1) = 60 / 99
线是
y - 20 = (60 / 99) * (x - 1)
那么:
y = (60 / 99) * (x - 1) + 20
然后,测试 x = 50:
y = (60 / 99) * (50 - 1) + 20 = 2940 / 99 + 20 != 40
因此,不存在这样的线性缩放。
You need to be more specific about what you're looking for. The rules you given do not produce a consistent LINEAR scaling.
For, if it were linear:
Slope is:
Line is
Then:
Then, testing x = 50:
x = 50
Thus, there is no such LINEAR scaling.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
暂无简介
文章 0 评论 0
接受
发布评论
评论(2)
您正在寻找一个函数 f ,这样:
然后
您得到:
99a +20 = 80
看一下这个问题以获取更多信息:
反转并转换滑块值
注意:如果 50 缩放为40 你的转变不是线性的。所以你需要寻找另一种类型的函数:
f(x) = ax**2 + bx + c
You're looking for a function f such that :
Then
You get :
99a +20 = 80
Have a look at this question for more information :
Invert and convert slider value
Note: if 50 scales to 40 your transformation is not linear. So you need to look for another type of function:
f(x) = ax**2 + b x + c
您需要更具体地说明您要寻找的内容。您给出的规则不会产生一致的线性缩放。
例如,如果它是线性的:
斜率是:
线是
那么:
然后,测试 x = 50:
因此,不存在这样的线性缩放。
You need to be more specific about what you're looking for. The rules you given do not produce a consistent LINEAR scaling.
For, if it were linear:
Slope is:
Line is
Then:
Then, testing
x = 50
:Thus, there is no such LINEAR scaling.