summaryrefslogtreecommitdiff
path: root/Build/source/utils/asymptote/transform.h
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/utils/asymptote/transform.h')
-rw-r--r--Build/source/utils/asymptote/transform.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/Build/source/utils/asymptote/transform.h b/Build/source/utils/asymptote/transform.h
index 9b0e402da39..41c1f176051 100644
--- a/Build/source/utils/asymptote/transform.h
+++ b/Build/source/utils/asymptote/transform.h
@@ -217,6 +217,14 @@ inline transform reflectabout(pair z, pair w)
return basis * flip * inverse(basis);
}
+// Return the rotational part of t.
+inline transform rotation(transform t)
+{
+ pair z(2.0*t.getxx()*t.getyy(),t.getyx()*t.getyy()-t.getxx()*t.getxy());
+ if(t.getxx() < 0) z=-z;
+ return rotate(atan2(z.gety(),z.getx()));
+}
+
// Remove the x and y components, so the new transform maps zero to zero.
inline transform shiftless(transform t)
{