我有以下的代码行: 我已经在矩形上应用了少量旋转,而不知道数值(多少度)。现在我想要在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。 我想在应用转换后获得角度。 –