-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
changed definitions.hpp to enums.hpp and added utilityfunctions.hpp
- Loading branch information
Dwatkins
committed
Aug 16, 2017
1 parent
29a4ee2
commit 741675a
Showing
3 changed files
with
21 additions
and
0 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
namespace AUTOCHAIR | ||
{ | ||
|
||
// maps inVal from the range of inMin-inMax to the range of outMin-outMax | ||
int mapRange(int inVal, int inMin, int inMax, int outMin, int outMax) | ||
{ | ||
int outVal = outMin + ((outMax-outMin) * 100 * (inVal-inMin) / (inMax-inMin)) / 100; | ||
|
||
if(outVal > outMax) | ||
{ | ||
outVal = outMax; | ||
} | ||
else if (outVal < outMin) | ||
{ | ||
outVal = outMin; | ||
} | ||
|
||
return outVal; | ||
} | ||
|
||
} |
Binary file not shown.