diff options
Diffstat (limited to 'Build/source/utils/asymptote/tests/arith/transform.asy')
-rw-r--r-- | Build/source/utils/asymptote/tests/arith/transform.asy | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/Build/source/utils/asymptote/tests/arith/transform.asy b/Build/source/utils/asymptote/tests/arith/transform.asy new file mode 100644 index 00000000000..e4e44e387b8 --- /dev/null +++ b/Build/source/utils/asymptote/tests/arith/transform.asy @@ -0,0 +1,25 @@ +import TestLib; +pair x = (1, 2); +StartTest("identity transform"); +assert(identity()*x == x); +EndTest(); +StartTest("shift transform"); +assert(shift((1,1))*x == (2, 3)); +assert(shift(1,1)*x == (2, 3)); +EndTest(); +StartTest("scaling transforms"); +assert(xscale(2)*x == (2, 2)); +assert(yscale(2)*x == (1, 4)); +assert(scale(2)*x == (2, 4)); +EndTest(); +StartTest("slant transform"); +assert(slant(1)*x == (3, 2)); +EndTest(); +StartTest("rotation transform"); +assert(length((rotate(90)*x) - (-2,1)) <= realEpsilon); +assert(rotate(90, x)*x == x); +EndTest(); +StartTest("reflect transform"); +assert(reflect((-1, -1), (1, 1))*x == (2, 1)); +EndTest(); + |