Transforming shapes on a coordinate grid