Top-rated recipes tagged "vector"http://code.activestate.com/recipes/tags/vector/top/2016-08-07T22:02:10-07:00ActiveState Code RecipesAuto differentiation (Python) 2016-08-07T22:02:10-07:00Raymond Hettingerhttp://code.activestate.com/recipes/users/178123/http://code.activestate.com/recipes/580610-auto-differentiation/ <p style="color: grey"> Python recipe 580610 by <a href="/recipes/users/178123/">Raymond Hettinger</a> (<a href="/recipes/tags/autodifferentiation/">autodifferentiation</a>, <a href="/recipes/tags/calculus/">calculus</a>, <a href="/recipes/tags/descent/">descent</a>, <a href="/recipes/tags/gradient/">gradient</a>, <a href="/recipes/tags/math/">math</a>, <a href="/recipes/tags/optimization/">optimization</a>, <a href="/recipes/tags/vector/">vector</a>). Revision 5. </p> <p>Directly computes derivatives from ordinary Python functions using auto differentiation. The technique directly computes the desired derivatives to full precision without resorting to symbolic math and without making estimates bases on numerical methods.</p> <p>The module provides a Num class for "dual" numbers that performs both regular floating point math on a value and its derivative at the same time. In addition, the module provides drop-in substitutes for most of the functions in the math module. There are also tools for partial derivatives, directional derivatives, gradients of scalar fields, and the curl and divergence of vector fields.</p> Vectorize Operation (Python) 2011-02-05T05:36:19-08:00Shao-chuan Wanghttp://code.activestate.com/recipes/users/4168519/http://code.activestate.com/recipes/577563-vectorize-operation/ <p style="color: grey"> Python recipe 577563 by <a href="/recipes/users/4168519/">Shao-chuan Wang</a> (<a href="/recipes/tags/vector/">vector</a>). Revision 2. </p> <p>This python submodule enable you to do the vectorize calculation, such as vectorize add, and etc.</p> Python Vectors (Python) 2009-11-25T04:50:10-08:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/576908-python-vectors/ <p style="color: grey"> Python recipe 576908 by <a href="/recipes/users/2608421/">Stephen Chappell</a> (<a href="/recipes/tags/fast/">fast</a>, <a href="/recipes/tags/point/">point</a>, <a href="/recipes/tags/vector/">vector</a>). Revision 3. </p> <p>This recipe implements vectors in pure Python and does not use "C" for speed enhancements. As a result, much effort has gone towards optimizing the instructions for the class methods. There are a few things that have yet to be improved, but it is being posted as an RFC. Comments on the structure, method names, and coding technique are requested for change. Once this code is standardized, work may commence on writing Vector3, Vector4, and VectorX. Please note that there is a difference between the "direction" and "degrees" properties.</p>