Package libavg :: Module mathutil

Module mathutil

source code

Classes
  EquationNotSolvable
  EquationSingular
  MovingAverage
Moving average implementation.
Functions
 
getAngle(p1, p2) source code
 
getDistance(p, q) source code
 
getDistSquared(p, q) source code
 
getScaleToSize((width, height), (max_width, max_height)) source code
 
getScaledDim(size, max=None, min=None) source code
 
gauss_jordan(m, eps=1e-10)
Puts given matrix (2D array) into the Reduced Row Echelon Form.
source code
 
solveEquationMatrix(_matrix, eps=1e-10) source code
 
getOffsetForMovedPivot(oldPivot, newPivot, angle) source code
 
isNaN(x) source code
 
sgn(x) source code
Function Details

gauss_jordan(m, eps=1e-10)

source code 

Puts given matrix (2D array) into the Reduced Row Echelon Form. Returns True if successful, False if 'm' is singular. NOTE: make sure all the matrix items support fractions! Int matrix will NOT work! Written by Jarno Elonen in April 2005, released into Public Domain http://elonen.iki.fi/code/misc-notes/affine-fit/index.html