Created
August 29, 2018 05:05
-
-
Save iamchiwon/dbfd9de8ecafd6e9c486ccdafce35cdf to your computer and use it in GitHub Desktop.
비례에 따른 값의 범위 변환
This file contains hidden or 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
| func ratioMap(_ _min: CGFloat, _ _max: CGFloat) -> (CGFloat, CGFloat) -> (CGFloat) -> CGFloat { | |
| return { start, end in | |
| { value in | |
| start + (value - _min) * (end - start) / (_max - _min) | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment