簡體   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