mirror of
https://github.com/ShikyC/Taiko-Drum-Controller-Arduino.git
synced 2024-11-27 15:40:48 +01:00
泰勒展开yyds
This commit is contained in:
parent
5cd0dfe75c
commit
620ef18892
@ -126,7 +126,11 @@ void loop() {
|
||||
}
|
||||
lastPower[p][i] = power[p][i];
|
||||
#else
|
||||
float v = pow(5.0, sensitivities[p][i] / 2048.0 - 1) * power[p][i];
|
||||
float x = sensitivities[p][i] / 2048.0 - 1;
|
||||
float x2 = x * x;
|
||||
float x3 = x2 * x;
|
||||
float x4 = x3 * x;
|
||||
float v = 1.0 + x + 0.5 * x2 + 0.166667 * x3;
|
||||
axisValues[p][i] = AXIS_RANGE * (v >= MAX_THRES ? 1 : (v / MAX_THRES));
|
||||
#endif
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user