繁体   English   中英

C#矩阵乘法库

[英]C# Matrix Multiplication Library

我正在尝试将2个矩阵相乘。 我正在using System.Windows.Media ,但仍在Matrix下出现红色的弯曲。 我可以告诉我正在using System.Windows.Media进行注册,因为它需要我决定是否要为Color使用System.Windows.MediaSystem.Drawing 这是我的代码:

        Matrix matrix1 = new Matrix(5, 10, 15, 20, 25, 30);
        Matrix matrix2 = new Matrix(2, 4, 6, 8, 10, 12);

        // matrixResult is equal to (70,100,150,220,240,352) 
        Matrix matrixResult = Matrix.Multiply(matrix1, matrix2);

        // matrixResult2 is also 
        // equal to (70,100,150,220,240,352) 
        Matrix matrixResult2 = matrix1 * matrix2;

有什么建议为什么using System.Windows.Media不能使代码正确? 我已经添加了PresentationCore参考。

尝试将其放在.cs的顶部:

using Matrix = System.Windows.Media.Matrix;

这可能是因为您的导入中包含System.Windows.Media以及System.Drawing

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM