Calc.GaussSolve Method
Solve a system of n equations in n unknowns using Gaussian Elimination
Solve an equation in matrix form Ax = b
The 2D array a is the matrix A with an additional column b.
This is often written (A:b)
A0,0 A1,0 A2,0 .... An-1,0 b0
A0,1 A1,1 A2,1 .... An-1,1 b1
A0,2 A1,2 A2,2 .... An-1,2 b2
: : : : :
: : : : :
A0,n-1 A1,n-1 A2,n-1 .... An-1,n-1 bn-1
Returns an array of solutions, or null if if the system of equations is singular.
Sample for solving center for a circle through three points:
double[] sm=new double[2,3]; //two rows, three coefficients
sm[0, 0] = 2 * p0.y - 2 * p1.y;
sm[0, 1] = 2 * p0.x - 2 * p1.x;
sm[0, 2] = -(p1.x * p1.x + p1.y * p1.y - p0.x * p0.x - p0.y * p0.y);
sm[1, 0] = 2 * p0.y - 2 * p2.y;
sm[1, 1] = 2 * p0.x - 2 * p2.x;
sm[1, 2] = -(p2.x * p2.x + p2.y * p2.y - p0.x * p0.x - p0.y * p0.y);
double[] center=Calc.GaussSolve(sm);
Public Shared Function GaussSolve( _
ByVal a As Double(,) _
) As Double()
This language is not supported or no code example is available.
This language is not supported or no code example is available.
public:
static array< double >^ GaussSolve(
array< double, 2 >^ a
)
This language is not supported or no code example is available.
public static function GaussSolve(
a : double[,]
) : double[];
This language is not supported or no code example is available.
Parameters
-
a
-
double[,]
Matrix
Return Value
double[]
Solution
.NET Framework
Supported in: 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8