Latest recipes tagged "math" and "python"http://code.activestate.com/recipes/tags/math+python/new/2016-04-08T01:42:01-07:00ActiveState Code RecipesProjectile Motion (Python)
2016-04-08T01:42:01-07:00Tage Burnetthttp://code.activestate.com/recipes/users/4193902/http://code.activestate.com/recipes/580638-projectile-motion/
<p style="color: grey">
Python
recipe 580638
by <a href="/recipes/users/4193902/">Tage Burnett</a>
(<a href="/recipes/tags/math/">math</a>, <a href="/recipes/tags/physics/">physics</a>, <a href="/recipes/tags/python/">python</a>).
</p>
<p>This program calculates the characteristics of a projectile in a vacuum at several different locations in our solar system.</p>
Russian Multiplication in Python (Python)
2013-06-18T15:25:02-07:00Captain DeadBoneshttp://code.activestate.com/recipes/users/4184772/http://code.activestate.com/recipes/578567-russian-multiplication-in-python/
<p style="color: grey">
Python
recipe 578567
by <a href="/recipes/users/4184772/">Captain DeadBones</a>
(<a href="/recipes/tags/math/">math</a>, <a href="/recipes/tags/multiplication/">multiplication</a>, <a href="/recipes/tags/python/">python</a>).
</p>
<p>Here is a very simple program in Python to multiply 2 numbers. This version follows the Russian Multiplication Algorithm. I worte for my blog <a href="http://thelivingpearl.com/basic-multiplication-in-python/">Captain DeadBones Chronicles</a></p>
Ten's Multiplication Algorithms in Python (Python)
2013-06-18T15:23:36-07:00Captain DeadBoneshttp://code.activestate.com/recipes/users/4184772/http://code.activestate.com/recipes/578566-tens-multiplication-algorithms-in-python/
<p style="color: grey">
Python
recipe 578566
by <a href="/recipes/users/4184772/">Captain DeadBones</a>
(<a href="/recipes/tags/math/">math</a>, <a href="/recipes/tags/multiplication/">multiplication</a>, <a href="/recipes/tags/python/">python</a>).
</p>
<p>Here is a very simple program in Python to multiply 2 numbers. This is following a Ten's multiplication algorithms. I worte for my blog <a href="http://thelivingpearl.com/basic-multiplication-in-python/">Captain DeadBones Chronicles</a></p>
Simple Addition Multiplication in Python (Python)
2013-06-18T15:21:45-07:00Captain DeadBoneshttp://code.activestate.com/recipes/users/4184772/http://code.activestate.com/recipes/578565-simple-addition-multiplication-in-python/
<p style="color: grey">
Python
recipe 578565
by <a href="/recipes/users/4184772/">Captain DeadBones</a>
(<a href="/recipes/tags/math/">math</a>, <a href="/recipes/tags/multiplication/">multiplication</a>, <a href="/recipes/tags/python/">python</a>).
</p>
<p>Here is a very simple program in Python to multiply 2 numbers. I worte for my blog <a href="http://thelivingpearl.com/basic-multiplication-in-python/">Captain DeadBones Chronicles</a></p>
Greatest Common Divisor using Recursion in Python (Python)
2013-01-16T16:44:46-08:00Captain DeadBoneshttp://code.activestate.com/recipes/users/4184772/http://code.activestate.com/recipes/578421-greatest-common-divisor-using-recursion-in-python/
<p style="color: grey">
Python
recipe 578421
by <a href="/recipes/users/4184772/">Captain DeadBones</a>
(<a href="/recipes/tags/gcd/">gcd</a>, <a href="/recipes/tags/math/">math</a>, <a href="/recipes/tags/python/">python</a>).
</p>
<p>I wrote this little piece of code as part of my ongoing python-math projects. For more information please checkout <a href="http://thelivingpearl.com">The Living Pearl</a>. </p>
Wasted Money Calculator (Python)
2012-01-26T02:27:25-08:00userendhttp://code.activestate.com/recipes/users/4179007/http://code.activestate.com/recipes/578026-wasted-money-calculator/
<p style="color: grey">
Python
recipe 578026
by <a href="/recipes/users/4179007/">userend</a>
(<a href="/recipes/tags/calculate/">calculate</a>, <a href="/recipes/tags/calculator/">calculator</a>, <a href="/recipes/tags/math/">math</a>, <a href="/recipes/tags/money/">money</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/save/">save</a>, <a href="/recipes/tags/tkinter/">tkinter</a>).
Revision 2.
</p>
<p>Calculate the amount of money you waste on the unnecessary items you buy everyday. </p>
Encrypt and Decrypt Text and Text Files (BETA) (Python)
2011-11-22T04:18:15-08:00Alexander James Wallarhttp://code.activestate.com/recipes/users/4179768/http://code.activestate.com/recipes/577954-encrypt-and-decrypt-text-and-text-files-beta/
<p style="color: grey">
Python
recipe 577954
by <a href="/recipes/users/4179768/">Alexander James Wallar</a>
(<a href="/recipes/tags/cryptography/">cryptography</a>, <a href="/recipes/tags/cryptology/">cryptology</a>, <a href="/recipes/tags/decrypt/">decrypt</a>, <a href="/recipes/tags/decryption/">decryption</a>, <a href="/recipes/tags/encrypt/">encrypt</a>, <a href="/recipes/tags/encryption/">encryption</a>, <a href="/recipes/tags/hidding/">hidding</a>, <a href="/recipes/tags/math/">math</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/text/">text</a>, <a href="/recipes/tags/text_files/">text_files</a>).
Revision 7.
</p>
<p>This program interactively lets you encrypt and decrypt text as well as text files using a key system as well as a cipher.</p>
Random Binary List (Python)
2011-11-09T19:38:14-08:00Alexander James Wallarhttp://code.activestate.com/recipes/users/4179768/http://code.activestate.com/recipes/577944-random-binary-list/
<p style="color: grey">
Python
recipe 577944
by <a href="/recipes/users/4179768/">Alexander James Wallar</a>
(<a href="/recipes/tags/base/">base</a>, <a href="/recipes/tags/binary/">binary</a>, <a href="/recipes/tags/list/">list</a>, <a href="/recipes/tags/math/">math</a>, <a href="/recipes/tags/numbers/">numbers</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/random/">random</a>, <a href="/recipes/tags/random_binary_list/">random_binary_list</a>).
</p>
<p>This recipe returns a list of size n such that the contents of the returned list are random 0s and 1s. It returns a random binary list of size n.</p>
Multiplication table (Python)
2011-04-21T09:12:26-07:00Boubakrhttp://code.activestate.com/recipes/users/4176416/http://code.activestate.com/recipes/577672-multiplication-table/
<p style="color: grey">
Python
recipe 577672
by <a href="/recipes/users/4176416/">Boubakr</a>
(<a href="/recipes/tags/math/">math</a>, <a href="/recipes/tags/multiplication/">multiplication</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/table/">table</a>).
</p>
<p>Multiplication table (Python)</p>
GPS distance and bearing between two GPS points (Python)
2011-05-21T23:44:35-07:00James Dysonhttp://code.activestate.com/recipes/users/4176784/http://code.activestate.com/recipes/577594-gps-distance-and-bearing-between-two-gps-points/
<p style="color: grey">
Python
recipe 577594
by <a href="/recipes/users/4176784/">James Dyson</a>
(<a href="/recipes/tags/gps/">gps</a>, <a href="/recipes/tags/math/">math</a>, <a href="/recipes/tags/python/">python</a>).
</p>
<p>This code outputs the distance between 2 GPS points showing also the vertical and horizontal bearing between them. This code was originally made for an Automatic Tracking Antenna Aimer. If you find it useful please take note of the owner. If you like it just leave a message please.</p>
Fastest way to list all primes below N in python (Python)
2010-07-27T01:57:20-07:00robert.william.hankshttp://code.activestate.com/recipes/users/4174481/http://code.activestate.com/recipes/577331-fastest-way-to-list-all-primes-below-n-in-python/
<p style="color: grey">
Python
recipe 577331
by <a href="/recipes/users/4174481/">robert.william.hanks</a>
(<a href="/recipes/tags/fast/">fast</a>, <a href="/recipes/tags/fastest/">fastest</a>, <a href="/recipes/tags/math/">math</a>, <a href="/recipes/tags/numbers/">numbers</a>, <a href="/recipes/tags/numpy/">numpy</a>, <a href="/recipes/tags/primes/">primes</a>, <a href="/recipes/tags/python/">python</a>).
Revision 6.
</p>
<p>I was looking for a fast way to list all primes below n,
so far i came up to this with the numpy solution the fastest.
It does primes up to 10e6 in 15ms in my old machine,
and it is capable of reaching 10e9. </p>