0
$\begingroup$
ContourPlot[Power[x,1.5]-Power[1.65,0.5]*x+y^2==0,{x,-5,5},{y,-5,5},PlotPoints->100,MaxRecursion->1]  

It's easy to get plot as below:
enter image description here
Then, I use Polarplot to plot the same thing,

p=Power[x,1.5]+y^2==Power[1.65,0.5]*x/.{x->r Cos[t],y->r Sin[t]}
foo=r/.First@Solve[p,r,Reals];
PolarPlot[foo,{t,-Pi,4Pi}]  

There's no plot when use Polarplot.
How to use PolarPlot(or ParametricPlot) for this plot?

$\endgroup$
5
  • $\begingroup$ The "First" solution is simply useless. The second solution is more likely what you wanted. $\endgroup$
    – 梁國淦
    Commented Mar 31, 2018 at 12:59
  • $\begingroup$ Or add the constraint r > 0 to Solve and there will only be only one solution. $\endgroup$
    – Bob Hanlon
    Commented Mar 31, 2018 at 13:55
  • $\begingroup$ If you take the second solution in your code, it is ok. p = Power[x, 1.5] + y^2 == Power[1.65, 0.5]*x /. {x -> r Cos[t], y -> r Sin[t]}; foo = r /. Solve[p, r, Reals][[2]]; PolarPlot[foo, {t, -Pi, 4 Pi}] $\endgroup$
    – Akku14
    Commented Mar 31, 2018 at 14:07
  • $\begingroup$ @Akku14,why do you add [[2]] after ` Solve[p, r, Reals]`? $\endgroup$
    – kittygirl
    Commented Mar 31, 2018 at 14:21
  • $\begingroup$ [[2]] is second part of expression. See in Help Part function. $\endgroup$ Commented Mar 31, 2018 at 14:28

1 Answer 1

1
$\begingroup$
trans = TransformedField["Cartesian" -> "Polar", 
Power[x, 1.5] - Power[1.65, 0.5]*x + y^2, {x, y} -> {r, \[Theta]}]

(* -1.284523258 r Cos[\[Theta]] + (r Cos[\[Theta]])^1.5 + r^2 Sin[\[Theta]]^2*)

sol = r /. Solve[trans == 0, r][[2]](*Second solution*)

(* 4.70073691*10^-16 Csc[\[Theta]]^4 (-1. Cos[\[Theta]] \
(-1.063663016*10^15 Cos[\[Theta]]^2 - 
  2.732599766*10^15 Sin[\[Theta]]^2) - 
1. Sqrt[0. + 1.131379012*10^30 Cos[\[Theta]]^6 + 
 5.813130617*10^30 Cos[\[Theta]]^4 Sin[\[Theta]]^2])*)  

PolarPlot[sol, {\[Theta], 10^-9, 4 Pi}, PlotRange -> {{0, 2}, {-1, 1}}]

enter image description here

$\endgroup$
3
  • $\begingroup$ In PolarPlot[sol, {\[Theta], 10^-9, 4 Pi},why do you set 10^-9?why not 0? $\endgroup$
    – kittygirl
    Commented Mar 31, 2018 at 14:02
  • $\begingroup$ I don't understand Second solution in Solve[trans == 0, r][[2]].What's the problem of my script? $\endgroup$
    – kittygirl
    Commented Mar 31, 2018 at 14:03
  • $\begingroup$ @kittygirl. if \[Theta] = 0 then is Indeterminate expression.Only for Second solution MMA give a nice plot. $\endgroup$ Commented Mar 31, 2018 at 14:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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