語言

Matrix.Rotate(Double) 方法

定義

以指定角度繞著該 Matrix 結構原點旋轉。

public:
 void Rotate(double angle);
public void Rotate(double angle);
member this.Rotate : double -> unit
Public Sub Rotate (angle As Double)

參數

angle
Double

旋轉角度。

範例

以下範例展示了如何旋轉一個 Matrix。

private Matrix rotateExample()
{
    
    // Creating a Matrix structure.
    Matrix myMatrix = new Matrix(5, 10, 15, 20, 25, 30);
    
    // Rotate the matrix 90 degrees about the origin.
    // myMatrix becomes equal to (-10, 5, -20, 15, -30, 25).
    myMatrix.Rotate(90);
    
    return myMatrix; 
}

適用於

另請參閱