Created
August 12, 2019 00:33
-
-
Save DeveloperPaul123/4ab1df90949019a7e62cbfe2e6c5ceb8 to your computer and use it in GitHub Desktop.
Revisions
-
DeveloperPaul123 renamed this gist
Aug 12, 2019 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
DeveloperPaul123 created this gist
Aug 12, 2019 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ #include <iostream> #include <cmath> double interpolate(double input_min, double input_max, double output_min, double output_max, double input_value) { return output_min + ((output_max - output_min)/(input_max - input_min)) * (input_value - input_min); } int main() { std::cout << std::floor(interpolate(-180.0, 180.0, 0.0, 359.0, 152.63)) << std::endl; return 0; }