2012-07-05 33 views

回答

1

矩形的质心位于其对角线的交点处(或所有顶点的算术平均值)。因此,倾斜后找到顶点坐标就足够了。

1

矩形的中心在倾斜后不会改变。 只有矩形的坐标根据以下公式改变。

x′=xcosθ − ysinθ 
y′=xsinθ + ycosθ 

其中,

(x,y)-initial co-ordinates of rectangle. 
    (x',y')-final co-ordinates of rectangle. 
    θ-angle of inclination. 

参见link详细。