Polar equations

2009 days ago by JAVIER

import numpy as np 
       
var('t') c = pi/4 def polar_fun(theta): return 3*cos(2*theta) def polar_fun_2(theta): return cos(2*(theta-c)) G = Graphics() tvec = np.linspace(0,2*pi,8) for k,x in enumerate(tvec[0:-1]): G += polar_plot(polar_fun, (t, x, x+pi/4), thickness=k+1) #G += polar_plot(polar_fun_2, (t, x, x+pi/4), thickness=k+1, color = 'red') G.show() 
       
var('t') c = pi/4 def polar_fun(theta): return cos(2*theta) def polar_fun_2(theta): return cos(2*(theta-c)) G = Graphics() tvec = np.linspace(0,2*pi,8) for k,x in enumerate(tvec[0:-1]): #G += polar_plot(polar_fun, (t, x, x+pi/4), thickness=k+1) G += polar_plot(polar_fun_2, (t, x, x+pi/4), thickness=k+1, color = 'red') G.show() 
       
var('t') c = pi/2 def polar_fun(theta): return cos(theta)-(theta) def polar_fun_2(theta): return cos(theta-c)-(theta-c) G = Graphics() tvec = np.linspace(0,2*pi,8) for k,x in enumerate(tvec[0:-1]): G += polar_plot(polar_fun, (t, x, x+pi/4), thickness=k+1) G += polar_plot(polar_fun_2, (t, x, x+pi/4), thickness=k+1, color = 'red') G.show() 
       
var('t') c = pi/4 def polar_fun(theta): return sqrt(2 + 2*sin(theta)) def polar_fun_2(theta): return cos(2*(theta-c)) G = Graphics() tvec = np.linspace(0,2*pi,8) for k,x in enumerate(tvec[0:-1]): G += polar_plot(polar_fun, (t, x, x+pi/4), thickness=k+1) #G += polar_plot(polar_fun_2, (t, x, x+pi/4), thickness=k+1, color = 'red') G.show() 
       
var('z') f = sqrt(2 + sin(z)) #f.integrate(z,0,2*pi) from scipy import integrate w = integrate.quad(polar_fun,0,2*pi) print w 
       
(7.999999999999998, 8.903988657493755e-14)
(7.999999999999998, 8.903988657493755e-14)
from scipy import integrate def some_polar_fun(z): return abs(-cos(z))/sqrt(1-sin(z)) w = integrate.quad(some_polar_fun,3*pi/2,2*pi) print w 
       
(0.8284271247461897, 9.197388681172367e-15)
(0.8284271247461897, 9.197388681172367e-15)