2
$\begingroup$

I attempted to plot a parametric plot using the following code:

q := Sqrt[((2 + \[Delta])*(4 + \[Delta]))/
      ((-2 - \[Delta]/2)^(4/(2 + \[Delta])^2)*
       (4 + \[Delta]*(6 + \[Delta])))]*
    ((1 - Cos[\[Theta]])^((\[Delta]*(4*M + \[Delta]))/
       (2*(2*M + \[Delta])^2))/(1 + Cos[\[Theta]])^(1/2))*
    (-3*M - \[Delta] + M*Cos[\[Theta]])^((2*M^2)/
      (2*M + \[Delta])^2) //. {M -> 1, \[Delta] -> 1}

R := ((2*M*Sin[\[Theta]])/Sqrt[(M + \[Delta] - M*Cos[\[Theta]])/
       (3*M + \[Delta] - M*Cos[\[Theta]])])*
    ((1 + q^2)/(2*q)) //. {\[Delta] -> 1, M -> 1}

Chop[ParametricPlot[{{R*((2*q)/(1 + q^2)), R*((1 - q^2)/(1 + q^2))}, {(-R)*((2*q)/(1 + q^2)), R*((1 - q^2)/(1 + q^2))}}, {\[Theta], 0, Pi}, PlotStyle -> {{Black}}, 
Axes -> None, PlotRange -> All, Exclusions -> None, Mesh -> False]]

However, I obtained such a graph:

enter image description here

where gaps can be seen although the plot should be continuous throughout. In my code, I have also tried several remedies proposed in earlier posts albeit none worked. How do I resolve this issue?

$\endgroup$
3
  • $\begingroup$ Apparently if I change the delta value from 1 to for e.g. 1.001, the graph will be completely continuous though I have no idea why that solves the issue. $\endgroup$
    – Thomas
    Mar 7 at 15:30
  • 2
    $\begingroup$ Use Chop (or Re) inside (not outside) ParametricPlot to ,,clear'' spurious several $MachineEpsilon imaginary parts. $\endgroup$ Mar 7 at 15:33
  • $\begingroup$ Just Simplify the functions: ParametricPlot[Evaluate[{{R*((2*q)/(1 + q^2)), R*((1 - q^2)/(1 + q^2))}, {(-R)*((2*q)/(1 + q^2)), R*((1 - q^2)/(1 + q^2))}} // Simplify], {\[Theta], 0, Pi}, PlotStyle -> Black, Axes -> None, PlotRange -> All, Exclusions -> None, Mesh -> False] $\endgroup$
    – Bob Hanlon
    Mar 8 at 1:39
1
$\begingroup$

This seems to do the job:

ParametricPlot[{{R*((2*q)/(1 + q^2)), 
   R*((1 - q^2)/(1 + q^2))}, {(-R)*((2*q)/(1 + q^2)), 
   R*((1 - q^2)/(1 + q^2))}}, {\[Theta], 0, Pi}, 
 PlotStyle -> {{Black}}, Axes -> None, PlotRange -> All, 
 Exclusions -> None, Mesh -> False, PlotPoints -> 10, 
 WorkingPrecision -> 20]

So does the other two suggestions by Andrzej Odrzywolek.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.