5
$\begingroup$

Plotted region above x-axis is jagged due to presence of Sqrt for y coordinate entailing delay in determining onset of real values. There is some improvement with higher number of points chosen,but gets slower.Is there a work around?

ClearAll["Global`*"]
x[ph_, m_] := Sin[ph]/m;
y[ph_, m_] := Sqrt[m^2 - Cos[ph]^2];
ParametricPlot[{x[ph, m], y[ph, m]}, {ph, -Pi/2, Pi/2}, {m, 0.5, 2.5},
               PlotStyle -> Yellow, PlotPoints -> {50, 50}]

Mathematica graphics

$\endgroup$

1 Answer 1

7
$\begingroup$

The jagged effect is caused by small imaginary parts popping in near the axis. Try for example y[10^-4, 10^-4]. Then, once the cause is known ...

x[ph_, m_] = Sin[ph]/m;
y[ph_, m_] = Sqrt[m^2 - Cos[ph]^2];

ParametricPlot[
 Re@{x[ph, m], y[ph, m]}, {ph, -Pi/2, Pi/2}, {m, 0.5, 2.5}, 
 PlotStyle -> Yellow, PlotPoints -> {50, 50}]

Mathematica graphics

$\endgroup$
8
  • $\begingroup$ You didn't change too much, did you? Very nice ! $\endgroup$
    – eldo
    Sep 20, 2014 at 20:47
  • $\begingroup$ @eldo "a minimalist approach" :) $\endgroup$ Sep 20, 2014 at 20:54
  • $\begingroup$ @belisarius .. but with maximalist effect!. Thanks. $\endgroup$
    – Narasimham
    Sep 20, 2014 at 20:57
  • $\begingroup$ +1, pardon my dullness but could you explain how this works? When I plot e.g. ParametricPlot[{x, Sqrt[Cos[x]]}, {x, -Pi, Pi}] it seems like ParametricPlot is already ignoring any imaginary component? $\endgroup$
    – C. E.
    Sep 20, 2014 at 21:00
  • 2
    $\begingroup$ @Pickett Not sure if I'm understanding your concern, but ParametricPlot doesn't ignore imaginary components, it considers them "out of region": ParametricPlot[{x, If[y > x, y, y + 10^-13 I]}, {x, 0, 1}, {y, 0, 1}] $\endgroup$ Sep 20, 2014 at 21:26

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.