Skip to main content
2 of 2
Grammar/choice of word etc.
C. E.
  • 71.2k
  • 6
  • 141
  • 269

What is wrong with this code?

I am plotting polar curves with PolarPlot and I tried plotting a parabola with $\frac{2}{1-\cos x}$ and $\sec x$.

Obviously there are two singularities that have to be considered, $\cos x=1$ and $\cos x=0$. I dont know how to specify multiple singularities for the same function or variable. This is what I have tried so far:

PolarPlot[{2/(1 - Cos[x]), Sec[x]}, {x, 0, 2 \[Pi]}, 
 Exclusions -> {Cos[x] == 0, 1}]

PolarPlot[{2/(1 - Cos[x]), Sec[x]}, {x, 0, 2 \[Pi]}, 
 Exclusions -> {x == 0, 2 \[Pi], \[Pi]/2, (3 \[Pi])/2}]

PolarPlot[{2/(1 - Cos[x]), Sec[x]}, {x, 0, 2 \[Pi]}, 
 Exclusions -> {Cos[x] == 0, Cos[x]==1}]

What is the right way to do this?

Any help appreciated. Thank you.

Shobhit
  • 189
  • 6