java.lang.Object
org.monte.media.math.LinearEquations
LinearEquations.
Reference: http://en.wikipedia.org/wiki/Cramer's_rule http://en.wikipedia.org/wiki/Determinant
- Author:
- Werner Randelshofer
-
Method Summary
Modifier and TypeMethodDescriptionstatic doubledet(double a, double b, double c, double d) Computes the determinant of a 3x3 matrix using Sarrus' rule.static doubledet(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.
-
Method Details
-
solve
public 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.a*x + b*y = e c*x + d*y = f
- Parameters:
a-b-c-d-e-f-
-
solve
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) Solves a linear system for x,y,z with cramer's rule.a*x + b*y + c*z = j d*x + e*y + f*z = k g*x + h*y + i*z = l
- Parameters:
a-b-c-d-e-f-
-
det
public 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.| 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 |
- Parameters:
a-b-c-d-e-f-g-h-i-- Returns:
- the determinant
-
det
public static double det(double a, double b, double c, double d) Computes the determinant of a 3x3 matrix using Sarrus' rule.| a, b | | c, d | = a*d - b*c
- Parameters:
a-b-c-d-- Returns:
- the determinant
-