MCPcopy Create free account
hub / github.com/KAlO2/PerfectShow / angle

Function angle

jni/venus/region_operation.cpp:268–276  ·  view source on GitHub ↗

here are some useful links about hypot, I tried to use std::hypot(x, y), later changed to std::sqrt(a*a + b*b); http://stackoverflow.com/questions/3764978/why-hypot-function-is-so-slow also STL Bugs Fixed In Visual Studio 2012 718865 STL: hypot not hoisted into the std namespace by cmath https://blogs.msdn.microsoft.com/vcblog/2012/06/15/stl-bugs-fixed-in-visual-studio-2012/ */

Source from the content-addressed store, hash-verified

266 https://blogs.msdn.microsoft.com/vcblog/2012/06/15/stl-bugs-fixed-in-visual-studio-2012/
267*/
268static float angle(const Vec2f& v1, const Vec2f& v2)
269{
270 float numerator = v1[0]*v2[0] + v1[1]*v2[1]; // v1.dot(v2);
271 float v1_length = std::sqrt(v1[0]*v1[0] + v1[1]*v1[1]);
272 float v2_length = std::sqrt(v2[0]*v2[0] + v2[1]*v2[1]);
273 float denominator = v1_length * v2_length;
274// assert(!isZero<T>(denominator));
275 return std::acos(numerator/denominator);
276}
277
278static cv::Vec2f rotate(const cv::Vec2f& v, float angle)
279{

Callers 1

getFaceFeaturePointsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected