{ "metadata": { "name": "", "signature": "sha256:76f79faa2162ff77522efd0b481592c6075b12f1a6e0662addba02fddb8f4f38" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Plotting Examples" ] }, { "cell_type": "code", "collapsed": false, "input": [ "%matplotlib inline\n", "from numpy import sin,cos,pi,linspace\n", "from pylab import plot\n", "\n", "# Play with these number and ignore the rest\n", "R = 10\n", "r = 0.4\n", "O = 12\n", "\n", "t = linspace(-pi,pi,3000)\n", "x = (R+r)*cos(t) - (r+O)*cos(((R+r)/r)*t)\n", "y = (R+r)*sin(t) - (r+O)*sin(((R+r)/r)*t)\n", "plot(x,y)" ], "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "code", "collapsed": false, "input": [ "?linspace" ], "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "code", "collapsed": false, "input": [ "delta = pi/2\n", "t = linspace(-pi,pi,300)\n", "x = sin(3 * t + delta)\n", "y = sin(5 * t)\n", "plot(x,y)" ], "language": "python", "metadata": {}, "outputs": [] } ], "metadata": {} } ] }