Last active
April 13, 2018 06:42
-
-
Save serguei-k/e7f5d66330d40a30e268c2ea55bddd22 to your computer and use it in GitHub Desktop.
Translation Average
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
MVector translationAverage(const std::vector<MVector>& values) | |
{ | |
if (values.empty()) return MVector::zero; | |
const MVector sum = std::accumulate(values.begin(), values.end(), MVector::zero); | |
return sum / values.size(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment