Package libavg :: Module mathutil

Module mathutil

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

gauss_jordan(m, eps=1e-10)

 

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