Skip to content

Commit 75d83a2

Browse files
committed
Tests for LinearTransformation
1 parent 7f7bdff commit 75d83a2

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/commontransformations.jl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,19 @@ CoordinateTransformations.transform_deriv(::SquareMe, x0) = diagm(2*x0)
4949
end
5050
end
5151

52+
@testset "LinearTransformation" begin
53+
M = [1 2; 3 4]
54+
x = [1,0]
55+
y = [0,1]
56+
L = LinearTransformation(M)
57+
@test L(x) == M*x
58+
@test inv(L)(x) == inv(M)*x
59+
@test inv(L)(y) == inv(M)*y
60+
@test inv(L)(L(x)) x
61+
@test inv(L)(L(y)) y
62+
@test (LL)(x) == (M*M)*x
63+
end
64+
5265
@testset "Translation" begin
5366
x = Point(1.0, 2.0)
5467
trans = Translation(2.0, -1.0)

0 commit comments

Comments
 (0)