编辑代码

using System;
using System.Numerics;
class Program
{
    public static void Main(string[] args)
    {
        Matrix4x4 matrix = new Matrix4x4(
                            1, 0, 0, 0,
                            0, 1, 0, 0,
                            0, 0, 1, 0,
                            0, 0, 0, 1
                        );
        
        // 创建一个列向量
        Vector4 vector = new Vector4(1.0f, 2.0f, 3.0f, 4.0f);
        
        // 矩阵乘以列向量
        Vector4 result = Vector4.Transform(vector, matrix);
        
        // 输出结果
        Console.WriteLine("Result X: " + result.X);
        Console.WriteLine("Result Y: " + result.Y);
        Console.WriteLine("Result Z: " + result.Z);
        Console.WriteLine("Result W: " + result.W);
    }
}