Polygon2d Polygon2d::scaleaboutcentroid(float scale) { Polygon2d n; V2d cen=centroid(); for (int i=1;i<=vs.len;i++) { V2d x=vs.num(i); x=x-cen; x=x*scale; x=x+cen; n.add(x); } return n; }
Polygon2d Polygon2d::operator*(float f) { Polygon2d p; for (int i=1;i<=vs.len;i++) p.add(vs.num(i)*f); return p; }