public class LinearEquations
extends java.lang.Object
LinearEquations
.
Reference: http://en.wikipedia.org/wiki/Cramer's_rule http://en.wikipedia.org/wiki/Determinant
Modifier and Type | Method and Description |
---|---|
static double |
det(double a,
double b,
double c,
double d)
Computes the determinant of a 3x3 matrix using Sarrus' rule.
|
static double |
det(double a,
double b,
double c,
double d,
double e,
double f,
double g,
double h,
double i)
Computes the determinant of a 2x2 matrix using Sarrus' rule.
|
static double[] |
solve(double a,
double b,
double c,
double d,
double e,
double f)
Solves a linear system for x,y with cramer's rule.
|
static double[] |
solve(double a,
double b,
double c,
double d,
double e,
double f,
double g,
double h,
double i,
double j,
double k,
double l)
Solves a linear system for x,y,z with cramer's rule.
|
public static double[] solve(double a, double b, double c, double d, double e, double f)
a*x + b*y = e c*x + d*y = f
a
- b
- c
- d
- e
- f
- public static double[] solve(double a, double b, double c, double d, double e, double f, double g, double h, double i, double j, double k, double l)
a*x + b*y + c*z = j d*x + e*y + f*z = k g*x + h*y + i*z = l
a
- b
- c
- d
- e
- f
- public static double det(double a, double b, double c, double d, double e, double f, double g, double h, double i)
| a, b, c | |e, f| |d, f| |d, e| | d, e, f | = a*|h, i|-b*|g, i|+c*|g, h|=aei+bfg+cdh-ceg-bdi-afh | g, h, i |
a
- b
- c
- d
- e
- f
- g
- h
- i
- public static double det(double a, double b, double c, double d)
| a, b | | c, d | = a*d - b*c
a
- b
- c
- d
-