Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You don't have to multiply x, y values by 2. Instead you can multiply each point by 2. So your code will be:

for(i=0; i<points.size(); i++)
    points[i] *= 2;

I don't think you can write the multiplication shorter and clearer than that.