Overview | Package | Class | Tree | Deprecated | Index | Help
| Copyright 2012-04-26 Werner Randelshofer
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.monte.media.math
Class LinearEquations

    java.lang.Object
      org.monte.media.math.LinearEquations

    public class LinearEquations

extends java.lang.Object

`LinearEquations`.

Reference: http://en.wikipedia.org/wiki/Cramer's_rule http://en.wikipedia.org/wiki/Determinant

Version:
  $Id: LinearEquations.java 187 2012-03-28 11:49:30Z werner $
Author:
  Werner Randelshofer

Method Summary
`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.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### 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

Overview | Package | Class | Tree | Deprecated | Index | Help
| Copyright 2012-04-26 Werner Randelshofer
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD