Skip to content

Instantly share code, notes, and snippets.

@benlau
Created March 26, 2019 06:24
Show Gist options
  • Save benlau/c19fa8801fa162c659086df4bab52cdc to your computer and use it in GitHub Desktop.
Save benlau/c19fa8801fa162c659086df4bab52cdc to your computer and use it in GitHub Desktop.
qreal a = mat.at<double>(0,0);
qreal b = mat.at<double>(1,0);
qreal c = mat.at<double>(0,1);
qreal d = mat.at<double>(1,1);
qreal e = mat.at<double>(0,2);
qreal f = mat.at<double>(1,2);
m_sx = sqrt(a * a + b * b);
m_sy = sqrt(c * c + d * d);
m_dx = e;
m_dy = f;
if (a * d - c * b < 0) {
if (a < d) {
m_sx = -m_sx;
} else {
m_sy = -m_sy;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment