2012-07-05 40 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詳細。