diff --git a/geometry_test.go b/geometry_test.go index 13f90e2fd39a0afbba5b4c9c2850b691103572e6..b1ce00fd642b8862ea8c75689c2e72c75d90c879 100644 --- a/geometry_test.go +++ b/geometry_test.go @@ -100,6 +100,12 @@ func TestMatrix_Unproject(t *testing.T) { assert.InDelta(t, unprojected.X, 2, delta) assert.InDelta(t, unprojected.Y, 2, delta) }) + t.Run("for rotated and moved matrix", func(t *testing.T) { + matrix := pixel.IM.Rotated(pixel.ZV, math.Pi/2).Moved(pixel.V(1, 1)) + unprojected := matrix.Unproject(pixel.V(1, 2)) + assert.InDelta(t, unprojected.X, 1, delta) + assert.InDelta(t, unprojected.Y, 0, delta) + }) t.Run("for singular matrix", func(t *testing.T) { matrix := pixel.Matrix{0, 0, 0, 0, 0, 0} unprojected := matrix.Unproject(pixel.ZV)