#! /usr/bin/env python """ Spiral.py is a program which make a polar plot of r = theta^2 i.e. the Galilean spiral Paul Eugenio Florida State University PHZ4151C 29 Jan 2019 """ from __future__ import division, print_function import matplotlib.pyplot as plt import numpy as np # use latex plt.rc('text', usetex=True) # define parameters thetaMin, thetaMax = 0, 10*np.pi steps = 1000 # use numpy vectorization to generate plotting values theta = np.linspace(thetaMin, thetaMax, steps) r = theta*theta x = r*np.cos(theta) y = r*np.sin(theta) # plot curve and decorate with latex equation plt.plot(x, y) plt.plot(x, y) plt.xlabel(r"$r(\theta)$") plt.ylabel(r"$\theta^2$") plt.title("Galilean spiral") plt.savefig("spiral.png") plt.show()