-1

Which library is available in .NET to solve equations like this efficiently?

enter image description here

The result should be

enter image description here

I need this kind of intermediate equation to calculate the minimal distance of a line g and a point P. Maybe there are some other libraries how have this functionality already included.

dannyyy
  • 1,784
  • 2
  • 19
  • 43

1 Answers1

3

Just to re-iterate the use of Math.NET. You want to rewrite your equation in the form of Ax=b and they simply code it as:

var A = Matrix<double>.Build.DenseOfArray(new double[,]
{
    {10, -10},
    {10, 10}
});
var b = Vector<double>.Build.Dense(new double[] {8, 1});
var x = A.Solve(b);
Console.WriteLine(x);

which gives you the solution, i.e. vector x as:

DenseVector 2-Double
 0.45
-0.35
rbm
  • 3,243
  • 2
  • 17
  • 28
  • Thank you for your example. I've played around with Math.NET but was not able to form the right equation to use the solve method. – dannyyy Apr 15 '16 at 11:37