我有以下的代碼行: 我已經在矩形上應用了少量旋轉,而不知道數值(多少度)。現在我想要在2D中獲得元素的旋轉或角度。從矩陣變換計算角度
Rectangle element = (Rectangle)sender;
MatrixTransform xform = element.RenderTransform as MatrixTransform;
Matrix matrix = xform.Matrix;
third.Content = (Math.Atan(matrix.M21/matrix.M22)*(180/Math.PI)).ToString();
and the matrix is like following
|M11 M12 0|
|M21 M22 0|
|dx dy 1| which is Transformation Matrix I guess !!
這似乎不是正確的值。 我想要在角度0到360度
我想這是一個變換矩陣。 –
是的,它是C#中Transformation Matrix和IT類型的MatrixTransform。 我想在應用轉換後獲得角度。 –