Popular recipes tagged "matrix" but not "mathematics"http://code.activestate.com/recipes/tags/matrix-mathematics/2012-06-05T12:38:36-07:00ActiveState Code RecipesDeterminant of matrix of any order (Python) 2012-04-24T10:49:00-07:00Sachin Joglekarhttp://code.activestate.com/recipes/users/4181845/http://code.activestate.com/recipes/578108-determinant-of-matrix-of-any-order/ <p style="color: grey"> Python recipe 578108 by <a href="/recipes/users/4181845/">Sachin Joglekar</a> (<a href="/recipes/tags/algebra/">algebra</a>, <a href="/recipes/tags/determinant/">determinant</a>, <a href="/recipes/tags/matrix/">matrix</a>, <a href="/recipes/tags/order/">order</a>). </p> <p>A small snipet of code to find the determinant of a mtrix of any order.Input must be a list like [[1,2,3],[4,5,6],[7,8,9]] (for a matrix of order 3). Works fine.</p> A matrix generated by shifting the zeroth row (Python) 2012-06-05T12:38:36-07:00Andrej T.http://code.activestate.com/recipes/users/4182297/http://code.activestate.com/recipes/578149-a-matrix-generated-by-shifting-the-zeroth-row/ <p style="color: grey"> Python recipe 578149 by <a href="/recipes/users/4182297/">Andrej T.</a> (<a href="/recipes/tags/matrix/">matrix</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/shift/">shift</a>). Revision 7. </p> <p>ShiftMatrix is a class that generates matrix values by shifting the zeroth row left or right length_of_row times. For example: if you initialize it with sm = ShiftMatrix([1,2,3]), sm[1] will return [3,1,2]. Only the initial list is stored, the other values are generated at runtime.</p> Infix operators for numpy arrays (Python) 2010-06-07T05:57:07-07:00John Schulmanhttp://code.activestate.com/recipes/users/4171677/http://code.activestate.com/recipes/577201-infix-operators-for-numpy-arrays/ <p style="color: grey"> Python recipe 577201 by <a href="/recipes/users/4171677/">John Schulman</a> (<a href="/recipes/tags/array/">array</a>, <a href="/recipes/tags/infix/">infix</a>, <a href="/recipes/tags/matrix/">matrix</a>, <a href="/recipes/tags/multiplication/">multiplication</a>, <a href="/recipes/tags/numpy/">numpy</a>). Revision 3. </p> <p>This recipe adapts the infix operator trick from <a href="http://code.activestate.com/recipes/384122-infix-operators/" rel="nofollow">http://code.activestate.com/recipes/384122-infix-operators/</a> to give the appropriate behavior with numpy arrays, so you can write A *dot* B for np.dot(A,B)</p> <p>UPDATE A solution to the dot problem was recently added to the numpy trunk: the dot method was added to the ndarray class so you can write a.dot(b). See <a href="http://projects.scipy.org/numpy/ticket/1456" rel="nofollow">http://projects.scipy.org/numpy/ticket/1456</a></p> The Matrix Effect (JavaScript) 2009-07-28T10:13:20-07:00Panda Moniomhttp://code.activestate.com/recipes/users/4171270/http://code.activestate.com/recipes/576861-the-matrix-effect/ <p style="color: grey"> JavaScript recipe 576861 by <a href="/recipes/users/4171270/">Panda Moniom</a> (<a href="/recipes/tags/dynamic_drive/">dynamic_drive</a>, <a href="/recipes/tags/effect/">effect</a>, <a href="/recipes/tags/javascript/">javascript</a>, <a href="/recipes/tags/matrix/">matrix</a>, <a href="/recipes/tags/text/">text</a>). </p> <p>This code is and opensource code from Dynamic Drive.</p> <p>Add the Matrix effect to any text. I have displayed the code for and entire demo page. Any text that you want to have the Matrix effect, put it inside &lt;div id="matrix&gt; and &lt;/div&gt;.</p>