# ParametricPlot Incomplete

I have a problem to reproduce a graph. Follows the commands used:

X[r_] = -A Csc[ϕ];
Y[r_] = Sqrt[B + a^2 Cos[ϕ]^2 - A^2 Cot[ϕ]^2];
A = (r^2 (3 M - r) - a^2 (M + r))/(a (r - M));
B = (r^3 (4 a^2 M - r (3 M - r)^2))/(a^2 (r - M)^2);
M = 1; a = 0.79; ϕ = Pi/2;
ParametricPlot[{X[r], Y[r]}, {r, 0, 2 Pi}]


However, the graph should be as follows:

i.e., I haven't been able to close the curve. Someone can help? Some hint?

• simply look at your data ! Table[{X[r], Y[r]}, {r, 0, 2 Pi, .2 Pi}] and you'll see it generates complex numbers. Your code is also strange. Why write function X[r_] = -A Csc[\[Phi]]; when there is no explicit r in RHS? but your main problem is your data is complex. – Nasser Feb 16 at 5:02
• Thanks by the comments @Nasser. Note that both quantities A and B are defined on the third and fourth row, respectively. – sotnasac Feb 16 at 5:26
• Do you mean to say X[r_] := and Y[r_] :=? – Mark R Feb 16 at 8:55
• @MarkR, these are the functions to be plotted. Both are functions dependent on the variable r (see the definition of A and B). – sotnasac Feb 16 at 17:19

ClearAll[A,B,ϕ,X, Y]

X[r_] = -A Csc[ϕ];
Y[r_] = Sqrt[B + a^2 Cos[ϕ]^2 - A^2 Cot[ϕ]^2];

A = (r^2 (3 M - r) - a^2 (M + r))/(a (r - M));
B = (r^3 (4 a^2 M - r (3 M - r)^2))/(a^2 (r - M)^2);
M = 1; a = 0.79; ϕ = Pi/2;


Now check the domain of your function.

dom = FunctionDomain[{Y[r], r > 1}, r, Reals]

(*  1.83298 <= r <= 3.80951  *)


Plot both (X,Y) and (X,-Y) over the domain:

ParametricPlot[{{X[r], Y[r]}, {X[r], -Y[r]}},
{r, First@dom, Last@dom}, GridLines -> Automatic,
PlotStyle -> {{Black, Dashed}}, Frame -> True]


However, the left edge is not as vertical as in the desired plot.

Notice that we had to specify $$r>1$$ for our domain. There is a different solution for $$r<1$$. We should have specified $$r>M$$.

• thank you very much! About the left edge, simply set the value a=0.99 and we will have something like vertical. You have solved my problem, thanks again. – sotnasac Feb 16 at 17:13