不确定这是本网站的正确部分,但我有一个问题。
所以,我使用 MathNet.Numerics 来计算导数。我想在控制台中显示它们。
代码示例
using System;
using MathNet.Numerics;
namespace math
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
Func<double,double> f = x => 3 * Math.Pow(x, 3) + 2 * x - 6;
var test = Differentiate.DerivativeFunc(f, 1);
Console.WriteLine(test.ToString());
Console.ReadKey();
}
}
}
Run Code Online (Sandbox Code Playgroud)