summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 264a29a)
raw | patch | inline | side by side (parent: 264a29a)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Fri, 30 Jun 2006 03:54:17 +0000 (03:54 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Fri, 30 Jun 2006 03:54:17 +0000 (03:54 +0000) |
src/libnr/nr-matrix.cpp | patch | blob | history | |
src/libnr/nr-matrix.h | patch | blob | history |
index 24fa2e2064f291967d08c685de9419b2dbb4caf5..12a2f2fcbd7e8f75f3e584ce0f8ac17d8761b8a5 100644 (file)
--- a/src/libnr/nr-matrix.cpp
+++ b/src/libnr/nr-matrix.cpp
}
+/**
+ *
+ */
+bool Matrix::is_scale(Coord const eps) const {
+ return ( (fabs(_c[0] - 1.0) > eps || fabs(_c[3] - 1.0) > eps) &&
+ fabs(_c[1]) < eps &&
+ fabs(_c[2]) < eps );
+}
+
+
+/**
+ *
+ */
+bool Matrix::is_rotation(Coord const eps) const {
+ return ( fabs(_c[1]) > eps &&
+ fabs(_c[2]) > eps &&
+ fabs(_c[1] + _c[2]) < 2 * eps);
+}
+
+
diff --git a/src/libnr/nr-matrix.h b/src/libnr/nr-matrix.h
index 47196137ea0838685b77bb9a106b871cc50ce8a9..767c2105b40ccba9569c90b2262b61efffe353ae 100644 (file)
--- a/src/libnr/nr-matrix.h
+++ b/src/libnr/nr-matrix.h
*/
bool is_translation(Coord const eps = 1e-6) const;
+ /**
+ *
+ */
+ bool is_scale(Coord const eps = 1e-6) const;
+
+ /**
+ *
+ */
+ bool is_rotation(Coord const eps = 1e-6) const;
+
/**
*