Cônicas na forma polar

A forma geral de uma cônica na forma polar é $$ r = \frac{de}{e\cos{\theta} + 1} $$ Vamos fazer dois exemplos: $$r = \frac{2}{1+\cos{\theta}} \text{ e } r = \frac{3}{1+0.5\cos{\theta}}$$


In [1]:
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
theta = np.arange(-1.7,1.7,0.1)

In [2]:
r = lambda x: 2.0/(1+np.cos(x))

In [3]:
theta


Out[3]:
array([-1.70000000e+00, -1.60000000e+00, -1.50000000e+00, -1.40000000e+00,
       -1.30000000e+00, -1.20000000e+00, -1.10000000e+00, -1.00000000e+00,
       -9.00000000e-01, -8.00000000e-01, -7.00000000e-01, -6.00000000e-01,
       -5.00000000e-01, -4.00000000e-01, -3.00000000e-01, -2.00000000e-01,
       -1.00000000e-01,  1.55431223e-15,  1.00000000e-01,  2.00000000e-01,
        3.00000000e-01,  4.00000000e-01,  5.00000000e-01,  6.00000000e-01,
        7.00000000e-01,  8.00000000e-01,  9.00000000e-01,  1.00000000e+00,
        1.10000000e+00,  1.20000000e+00,  1.30000000e+00,  1.40000000e+00,
        1.50000000e+00,  1.60000000e+00])

In [4]:
rho =r(theta)
rho


Out[4]:
array([2.29580137, 2.06015556, 1.86787196, 1.70944972, 1.57791073,
       1.46804317, 1.375898  , 1.29844641, 1.2333422 , 1.17875411,
       1.1332458 , 1.09568892, 1.0651995 , 1.04109136, 1.02284185,
       1.01006705, 1.00250417, 1.        , 1.00250417, 1.01006705,
       1.02284185, 1.04109136, 1.0651995 , 1.09568892, 1.1332458 ,
       1.17875411, 1.2333422 , 1.29844641, 1.375898  , 1.46804317,
       1.57791073, 1.70944972, 1.86787196, 2.06015556])

In [5]:
## primeiro vou tentar um grafico polar
ax=plt.subplot(111,projection='polar')
ax.plot(theta,rho)


Out[5]:
[<matplotlib.lines.Line2D at 0x21278016940>]

In [6]:
ponto = lambda x: [r(x)*np.cos(x) , r(x)*np.sin(x)]
par = ponto(theta)

In [7]:
ax2=plt.subplot(111)
plt.grid()
ax2.plot(par[0],par[1])
ax2.plot([2,2],[-2,2])
ax2.plot([0,0], "ro")
ax2.set_aspect('equal')
plt.xlim(-1,4)
plt.savefig('conica3.png', format='png')



In [8]:
## O outro é uma elipse
theta1=np.arange(0,6.5,0.05)
r1=lambda x: 3/(1+0.5*np.cos(x))
ax3=plt.subplot(111,projection="polar")
ax3.plot(theta1,r1(theta1))


Out[8]:
[<matplotlib.lines.Line2D at 0x21204a3d130>]

In [9]:
## Em coordenadas cartesianas outra vez
ponto1 = lambda x: [r1(x)*np.cos(x),r1(x)*np.sin(x)]
elipse = ponto1(theta1)

In [10]:
ax4=plt.subplot(111)
plt.grid()
ax4.plot(elipse[0],elipse[1])
ax4.plot([6,6],[-3,3])
ax4.plot([0],[0], "ro")
ax4.set_aspect('equal')
plt.savefig('conica4.png',format="png")


A Hipérbole

Note que na definição de uma hipérbole temos $\|X-F\| = ed(X,L)$ com $e>1$. Ou seja a distância de $X$ ao foco é maior que a distância de $X$ à diretriz $L$ e nesse caso podemos ter: $$ \|X\| = e|\|X\|\cos(\theta)-d| = e(\|X\|\cos(\theta)-d)$$ ou seja $$\rho = \frac{ed}{e\cos(\theta) -1}$$ Vamos ver o exemplo: $$ \rho = \frac{4}{2\cos(\theta)+1} $$


In [11]:
theta3 = np.arange(-1.7,1.7,0.05)
r3 = lambda x : 4/(2*np.cos(x)+1)
ax4=plt.subplot(111,projection="polar")
ax4.plot(theta3,r3(theta3))


Out[11]:
[<matplotlib.lines.Line2D at 0x21204b99a30>]

In [12]:
ponto3 = lambda x: [r3(x)*np.cos(x),r3(x)*np.sin(x)]
hiperbole=ponto3(theta3)
ax5=plt.subplot(111)
plt.grid()
ax5.plot(hiperbole[0],hiperbole[1])
ax5.plot([2,2],[4,-4])
ax5.plot([0],[0],"ro")
ax5.set_aspect("equal")


Agora o outro ramo seria dado pela equação: $$ \rho = \frac{ed}{e\cos(\theta)-1} $$ e novamente veremos o exemplo: $$ \rho = \frac{4}{2\cos(\theta)-1} $$


In [13]:
theta4=np.arange(-0.8,0.8,0.05)
r4= lambda x : 4/(2*np.cos(x)-1)
ax4=plt.subplot(111,projection="polar")
ax4.plot(theta4,r4(theta4))


Out[13]:
[<matplotlib.lines.Line2D at 0x21204b78520>]

In [14]:
theta4=np.arange(-0.8,0.8,0.05)
ponto4 = lambda x : [r4(x)*np.cos(x),r4(x)*np.sin(x)]
hiperbole2 = ponto4(theta4)
ax6=plt.subplot(111)
ax6.plot(hiperbole2[0],hiperbole2[1])
ax6.plot(hiperbole[0],hiperbole[1])
plt.grid()
ax6.set_aspect("equal")
ax6.plot([2,2],[4,-4])
ax6.plot([0],[0],"ro")


Out[14]:
[<matplotlib.lines.Line2D at 0x21205294580>]

In [ ]: