You can do this in PostGIS using [ST_Affine](http://www.postgis.org/documentation/manual-svn/ST_Affine.html). The functionality to rotate around an arbitrary point was added to [ST_Rotate](http://www.postgis.org/documentation/manual-svn/ST_Rotate.html) for PostGIS 2.0.

If you have an earlier version (like PostGIS 1.5, or even earlier), you can add these functions:

    CREATE OR REPLACE FUNCTION st_rotate(geometry, double precision, geometry)
      RETURNS geometry AS
    'SELECT ST_Affine($1,  cos($2), -sin($2), 0,  sin($2),  cos($2), 0, 0, 0, 1, ST_X($3) - cos($2) * ST_X($3) + sin($2) * ST_Y($3), ST_Y($3) - sin($2) * ST_X($3) - cos($2) * ST_Y($3), 0)'
      LANGUAGE sql IMMUTABLE STRICT
      COST 100;
    COMMENT ON FUNCTION st_rotate(geometry, double precision, geometry) IS 'args: geomA, rotRadians, pointOrigin - Rotate a geometry rotRadians counter-clockwise about an origin.';
    
    CREATE OR REPLACE FUNCTION st_rotate(geometry, double precision, double precision, double precision)
      RETURNS geometry AS
    'SELECT ST_Affine($1,  cos($2), -sin($2), 0,  sin($2),  cos($2), 0, 0, 0, 1,	$3 - cos($2) * $3 + sin($2) * $4, $4 - sin($2) * $3 - cos($2) * $4, 0)'
      LANGUAGE sql IMMUTABLE STRICT
      COST 100;
    COMMENT ON FUNCTION st_rotate(geometry, double precision, double precision, double precision) IS 'args: geomA, rotRadians, x0, y0 - Rotate a geometry rotRadians counter-clockwise about an origin.';

See examples at [ST_Rotate](http://www.postgis.org/documentation/manual-svn/ST_Rotate.html) to get an idea on how to use it to rotate a geometry around an *x*, *y* point, including the centroid (common centre).

Because we all like math, the transformation matrix from the above functions is represented as:

    [ cos(θ)  | -sin(θ)  ||  x0 - cos(θ) * x0 + sin(θ) * y0 ]
    [ sin(θ)  |  cos(θ)  ||  y0 - sin(θ) * x0 - cos(θ) * y0 ]

Where *θ* is the counter-clockwise rotation about an origin, *x0* is the Easting/Longitude of the origin point, and *y0* is the Northing/Latitude. This math could possibly be adapted to *any* affine transformation tool.

To adapt this to qgsAffine, try using Translation X, Y values from calculations from the last column in the above matrix. For example, if you want to rotate a polygon 30° clockwise around 42°S, 174°E:

 * *x0* = 174; *y0* = -42; *θ*=-30 degrees or -0.523598776 radians
 * Scale X = 1
 * Scale Y = 1
 * Rotation X = -0.523598776
 * Rotation Y = 0.523598776
 * Translation X = *x0* - cos(*θ*) * *x0* + sin(*θ*) * *y0* = 44.31157974
 * Translation Y = *y0* - sin(*θ*) * *x0* - cos(*θ*) * *y0* = 81.37306696