Tag Archives: Newton-Raphson

Fun with Matrices

I’ll let the code speak for itself: In [81]: m = Matrix(array([[1.0,1.0],[0.0,1.0]]))   In [82]: def my_sqrt(x, num_iters): ….: r = 0.5*x ….: for i in xrange(num_iters): ….: r = 0.5*(r+x/r) ….: return r ….:   In [83]: m*m Out[83]: … Continue reading

Posted in Math, Programming, Python | Tagged , , | Leave a comment