How to Reverse an equation.. (c#)

I have this equation:

float temproll = roll / 1.66666f;       // Devide roll by 30
temproll = (temproll - 30.0f);          // - 30
helirollSpeed = Mathf.Abs((temproll));  // Turn negative into positive

Which provides me a speed on this sale:

alt text

But now i need to reverse this for a rotation to speed conversion like this:

16379-untitled.png

How would I go about this. Or how else could I turn rotation amount into a speed by this scale?

It’s very similar to the response which @Hoeloe wrote as answer to one of your previous questions. Solution:

speed = 30 - Mathf.Abs((angle - 45) / 1.5f);

Description from Hoeloe’s answer still apply, with the difference that you have to subtract the result from 30 to inverse speed.

What you could do is create a public AnimationCurve In unity, set the animation so that at 0.5 (50%) the value is 30 and at 0 (0%) and 1 (100%) the value is 0.

Then get a percentage from the value you are trying to convert…

Value/90=Percentage

Then, get the value from the animation curve using that percentage.