lua script that change value of x by dependence from y value. When y eqwal 556, x is…
- User
lua script that change value of x by dependence from y value. When y eqwal 556, x is eqwal 0, when y eqwal 1936, x is 98.
- Assistant
To achieve such functionality where the value of
xdepends on the value ofywith specific conditions, you can use a simple mathematical formula to create a linear relationship betweenyandx. Given two points(y1, x1) = (556, 0)and(y2, x2) = (1936, 98), you can find the equation of the line that connects these points and use it to computexfor any giveny.The formula for a line is
y = mx + b, where is the slope of the line and is the y-intercept. However, since we're dealing with a situation where changes with , we rearrange this to . First, we find and .