2
$\begingroup$

I don't know which command to determine the tangent lines that are parallel to the line $x=0$ (i.e. the y-axis) in Polar Coordinates. Can you help me please to give me some suggestions?

I attach some code which I have written:

theta = 45;
the = theta*Pi/180;
alp = 2;
gc = Sqrt[1 + alp*Sin[x - the]*Sin[x - the]];
yy = 1/gc;
PolarPlot[yy, {x, 0, 2*Pi}, PolarAxes -> True, 
 PolarTicks -> {"Degrees", Automatic}, PolarGridLines -> True, 
 Mesh -> 15, MeshStyle -> Directive[PointSize[Large], Red]]
$\endgroup$
  • $\begingroup$ Why not switch to parametric equations? #2/#1 & @@ D[yy {Cos[x], Sin[x]}, x]? $\endgroup$ – J. M. will be back soon Oct 14 '18 at 1:31
  • $\begingroup$ @J.M.issomewhatokay. YOU mean ff = #1/#2 & @@ D[yy {Cos[x], Sin[x]}, x]; mm = Solve[ff == 0, x]; here not #2/#1, Solve::ifun: Inverse functions are being used by Solve, so some solutions may not be found; use Reduce for complete solution information. $\endgroup$ – ABCDEMMM Oct 14 '18 at 2:12
3
$\begingroup$
yy = 1 / gc;
f[x_] := Evaluate[yy {Cos[x], Sin[x]}]
tangent[x_] := Evaluate[Simplify@FrenetSerretSystem[f[x], x][[2, 1]]]

pts1 = N[x /. Solve[{Divide @@ tangent[x] == 0, 0 <= x <= 2 Pi}, x, Reals]]

{0.197395, 3.33898}

pts2 = N[x /. Solve[{Divide[#2, #1] & @@ tangent[x] == 0, 0 <= x <= 2 Pi}, x, Reals]]

{4.51499, 1.3734007}

epilog = {Text[Style[ToString[Round[#/Degree, .1]] <> "°", Black],
       {.1, .05} + (f@#)] & /@ Join[pts1, pts2], 
    Thick, Purple, PointSize[Large] , Point[f /@ pts1], 
    Magenta, Point[f /@ pts2], Green, Point[f[#]], 
    Cyan, Line /@ ({{# - 1/3, #2}, {# + 1/3, #2}} & @@@ (f /@ pts2)), 
    Orange, Line /@ ({{#, #2 - 1/3}, {#, #2 + 1/3}} & @@@ (f /@ pts1)), 
    Red, Line[{f[#] - .5 tangent[#], f[#] + .5 tangent[#]}]} &;

Manipulate[PolarPlot[yy, {x, 0, 2 Pi}, Epilog -> epilog[-t]], {t, 0, 2 Pi, Pi/100}]

enter image description here

Using OP's code with the option Epilog:

PolarPlot[yy, {x, 0, 2*Pi}, PolarAxes -> True, 
 PolarTicks -> {"Degrees", Automatic}, PolarGridLines -> True, 
 Mesh -> 15, MeshStyle -> Directive[PointSize[Large], Red], 
 Epilog -> {Thick, Purple, PointSize[Large] , Point[f /@ pts1], 
   Magenta, Point[f /@ pts2], 
   Cyan, Line /@ ({{# - 1/2, #2}, {# + 1/2, #2}} & @@@ (f /@ pts2)), 
   Orange, Line /@ ({{#, #2 - 1/2}, {#, #2 + 1/2}} & @@@ (f /@ pts1))}]

enter image description here

Update: Starting with theta = 65; and going through the same steps:

PolarPlot[yy, {x, 0, 2*Pi}, PolarAxes -> True, 
 PolarTicks -> {"Degrees", Automatic}, PolarGridLines -> True, 
 Mesh -> 15, MeshStyle -> Directive[PointSize[Large], Red], 
 Epilog -> {Text[Style[ToString[Round[#/Degree, .1]] <> "°", Black],
       {.1, .05} + (f@#)] & /@ Join[pts1, pts2] , 
   Thick, Purple, PointSize[Large], Point[f /@ pts1], 
   Magenta, Point[f /@ pts2], 
   Cyan, Line /@ ({{# - 1/2, #2}, {# + 1/2, #2}} & @@@ (f /@ pts2)), 
   Orange, Line /@ ({{#, #2 - 1/2}, {#, #2 + 1/2}} & @@@ (f /@ pts1))}]

enter image description here

$\endgroup$
  • $\begingroup$ search the node: the tangent of node is parallel to the line x=0 ... not tangent in every node... $\endgroup$ – ABCDEMMM Oct 14 '18 at 0:38
  • $\begingroup$ @ABCDEMMM, please see the update. $\endgroup$ – kglr Oct 14 '18 at 2:22
  • $\begingroup$ nice to see! thanks a lot! $\endgroup$ – ABCDEMMM Oct 14 '18 at 2:26
  • $\begingroup$ is it possible that in the near of each node I can add the value of [Degrees], example: P1 = 10,33 Degree? P.S. I can do it in PPTX ... $\endgroup$ – ABCDEMMM Oct 14 '18 at 2:36
  • $\begingroup$ you mean Text[Style[ToString[Round[#/Degree, .1]] <> "°", Black] in labels ? $\endgroup$ – ABCDEMMM Oct 14 '18 at 3:28

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.