summaryrefslogtreecommitdiff
path: root/graphics/asymptote/transform.h
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-08-07 03:02:55 +0000
committerNorbert Preining <norbert@preining.info>2020-08-07 03:02:55 +0000
commit3710c23789342d9d88783cbe9ad23eb5263a7c33 (patch)
tree1c40b2bfb9f6b652f7877ad0991f5d6b44391154 /graphics/asymptote/transform.h
parentd99fea72e367e8d4d2809b43b3b0206b1bb526b8 (diff)
CTAN sync 202008070302
Diffstat (limited to 'graphics/asymptote/transform.h')
-rw-r--r--graphics/asymptote/transform.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/graphics/asymptote/transform.h b/graphics/asymptote/transform.h
index d421e2baec..158ea018f0 100644
--- a/graphics/asymptote/transform.h
+++ b/graphics/asymptote/transform.h
@@ -4,7 +4,7 @@
*
* The transform datatype stores an affine transformation on the plane
* The datamembers are x, y, xx, xy, yx, and yy. A pair (x,y) is
- * transformed as
+ * transformed as
* x' = t.x + t.xx * x + t.xy * y
* y' = t.y + t.yx * x + t.yy * y
*****/
@@ -209,7 +209,7 @@ inline transform reflectabout(pair z, pair w)
{
if (z == w)
reportError("points determining line to reflect about must be distinct");
-
+
// Also could be optimized.
transform basis = shift(z) * scale(w-z);
transform flip = yscale(-1.0);
@@ -223,25 +223,25 @@ 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 that the new transform maps zero to zero.
inline transform shiftless(transform t)
{
return transform(0, 0, t.getxx(), t.getxy(), t.getyx(), t.getyy());
-}
+}
// Return the translational component of t.
inline transform shift(transform t)
{
return transform(t.getx(), t.gety(), 1.0, 0, 0, 1.0);
-}
+}
// Return the translational pair of t.
inline pair shiftpair(transform t)
{
return pair(t.getx(), t.gety());
-}
+}
inline transform matrix(pair lb, pair rt)
{