# Need help with a math formula

### #1 jar913

jar913

GMC Member

• GMC Member
• 99 posts
• Version:GM8

Posted 14 December 2011 - 12:57 AM

Hey!
I'm not that good at math, and I am also tired.
So I would need some help with a formula for a clutch in my car physics project.
so I have a variable called clutch.
clutch is = 1 when it's fully released, and 0 when it is fully pressed down.
I also got a variabel called RPM, and it is exactly what you think it is.
I also want to use two variabels that we can call clutchMinRpm and clutchMaxRpm.
clutchMinRpm could be for example 1000, and that means that the clutch should be 1 when rpm, is = 1000.
clutchMaxRpm could be for example 2500, and that means that the clutch should be 0 when rpm is = 2500.
So I need to calculate what the clutch value should be between clutchMinRpm and clutchMaxRpm. Also, I don't want the clutch to decrease any further when it reaches 0, also not increase when it reaches 1.
I don't know if my explaining makes any sense, but basicly do I want the variable clutch to decreas liniar from 1 to 0 when the rpm increases from 1000 to 2500.

Edited by jar913, 14 December 2011 - 12:58 AM.

• 0

### #2 DanRedux

DanRedux

GMC Member

• GMC Member
• 1332 posts
• Version:GM:Studio

Posted 14 December 2011 - 05:21 AM

`clutch = median( 1, 0, 1 - ( RPM - clutchMinRpm ) / (clutchMaxRpm-clutchMinRpm) )`

• 0

#### 0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users