implements arcTo with generic 2D arrays