Matrix.RotateAtPrepend(Double, Double, Double) 方法

定義

在這個 Matrix 結構之前加上繞著指定的點進行的所指定角度的旋轉。

public:
 void RotateAtPrepend(double angle, double centerX, double centerY);
public void RotateAtPrepend (double angle, double centerX, double centerY);
member this.RotateAtPrepend : double * double * double -> unit
Public Sub RotateAtPrepend (angle As Double, centerX As Double, centerY As Double)

參數

angle
Double

旋轉角度 (以度數為單位)。

centerX
Double

旋轉中心的 X 座標。

centerY
Double

旋轉中心的 Y 座標。

範例

下列範例示範如何將旋轉 Matrix 前面加上 。

private Matrix prependRotateExample()
{

    Matrix myMatrix = new Matrix(5, 10, 15, 20, 25, 30);

    // Prepend a 90 degree rotation about the origin.
    // myMatrix is now equal to  (15,20,-5,-10,25,30).
    myMatrix.RotatePrepend(90);

    return myMatrix;
}

private Matrix prependRotateAboutPointExample()
{

    Matrix myMatrix = new Matrix(5, 10, 15, 20, 25, 30);

    // Prepend a 90 degree rotation about the 
    // point (100,100). 
    // myMatrix is now equal to  (15,20,-5,-10,1025,2030).
    myMatrix.RotateAtPrepend(90, 100, 100);

    return myMatrix;
}

備註

在複合轉換中,個別轉換的順序很重要。 例如,如果您第一次旋轉,然後縮放,則轉譯會得到與第一次轉譯、旋轉、縮放結果不同的結果。 其中一個原因是旋轉和縮放等轉換是在座標系統的原點上完成。 縮放位於原點的物件會產生與調整已移出原點的物件不同的結果。 同樣地,旋轉位於原點的物件會產生與旋轉已從原點移開的物件不同的結果。

適用於