I need Cartesian equation of the following star shape. As i want to use its Cartesian equation for Plot3D.
3 Answers
Another way to parameterize this curve is to recognize that it is a sine wave (of 18 cycles) plotted around the unit circle. One concise representation of the unit circle is with the real and imaginary parts of the complex exponential Exp[I 2 Pi t]. Hence:
f[t_] := Exp[I t ] (1 + 0.15 Sin[18 t + Pi/2]);
ParametricPlot[{Re[f[t]], Im[f[t]]}, {t, 0, 2 Pi}]
Guess_who_it_is suggests the even simpler version
PolarPlot[1 + 0.15 Sin[18 t + Pi/2], {t, 0, 2 Pi}]
which gives the same plot.
-
$\begingroup$ …or use
PolarPlot[]
. ;) $\endgroup$ Commented Jun 11, 2015 at 7:34
You'll need to set the radius of the curve (r
) that goes through the center of the cosine waves and the desired number of peaks (a
)
r = 6;
a = 18;
ListPlot[Table[{(r + Cos[a 2 π i/360]) Cos[2 π i/360] ,
(r + Cos[a 2 π i/360]) Sin[2 π i/360]}, {i, 360}],
AspectRatio -> 1]
-
$\begingroup$ The same, shorter
r = 6; a = 18; n = 360; ListPlot[(r + Cos[a #]) {Cos@#, Sin@#} & /@ Range[0, 2 Pi, 2 Pi/n], AspectRatio -> 1]
$\endgroup$ Commented Jun 11, 2015 at 5:23
Convert polar equation to use Intrinsic equation and ContourPlot:
ContourPlot[
1 + 1/8 Sin[18 ArcTan[x, y]] == Sqrt[x^2 + y^2], {x, -1.15,
1.15}, {y, -1.15, 1.15}, Axes -> True]
GroebnerBasis[]
for deriving this. This will likely be a very high-degree algebraic equation that will be too unwieldy to manipulate. $\endgroup$