I have 2 arrays of ints I am using to create a polygon (that looks like a fish). What do I need to do to the arrays to flip the polygon horizontally?
x = new int[]
{ 0, 18, 24, 30, 48, 60, 60, 54, 60, 48, 30, 24, 0 };
y = new int[]
{ 0, 18, 6, 0, 0, 12, 18, 24, 24, 36, 36, 30, 36 };
You need to find the maximum value of the
xarray. In this case it is60. Then set each x coordinate to60 - xusing a loop, like this: