3
$\begingroup$

I want to plot a 2D parametric function of the form: $$ f_x(\theta_1,\theta_2,\theta_3) = \cos(\theta_1)+\cos(\theta_1+\theta_2)+\cos(\theta_1+\theta_2+\theta_3) $$ $$ f_y(\theta_1,\theta_2,\theta_3) = \sin(\theta_1)+\sin(\theta_1+\theta_2)+\sin(\theta_1+\theta_2+\theta_3) $$

where the ranges for the input variables are: $ \theta_1 \in [-\pi,\pi]$ and $ \theta_2 \in [-\pi,\pi]$ and $ \theta_3 \in [\frac{-\pi }{2},\frac{\pi }{2}]$

I tried to use ParametricPlot, but it takes only two input variables.

Can any one help me with this?

$\endgroup$
3
$\begingroup$

I guess it should be a union of these things:

Table[ParametricPlot[With[{c = c},
  {Cos[a] + Cos[a + b] + Cos[a + b + c],
   Sin[a] + Sin[a + b] + Sin[a + b + c]}],
  {a, -Pi, Pi}, {b, -Pi, Pi}], {c, -Pi/2, Pi/2, Pi/24}]

enter image description here

Or

Show[%, PlotRange->All]

enter image description here

Using smaller step sizes in the Table command, it becomes pretty evident you get an annulus contained in the disk of radius 3. A little analysis shows that the annulus has outer radius 3 and inner radius $2\sqrt{2}-3 \approx -0.171573$.

$\endgroup$
  • $\begingroup$ I can't see the relevance for using a With Statement. $\endgroup$ – hieron Aug 10 '14 at 12:16
  • 1
    $\begingroup$ @hieron The With statement is certainly not necessary but makes it super simple to extract individual plots. You can use With[{c=Pi/2},___], for example to look at that particular image. It arose because I did exactly that when trying to figure out what was going on mathematically. Clearly, this would be particularly nice, if there were more cs in the expression. $\endgroup$ – Mark McClure Aug 10 '14 at 12:39
3
$\begingroup$
Manipulate[ParametricPlot [
    {Cos[a] + Cos[a + b] + Cos[a + b + c], 
     Sin[a] + Sin[a + b] + Sin[a + b + c]}, 
    {a, -Pi, Pi}, {b, -Pi, Pi}, PlotStyle -> Yellow], 
  {c, -Pi/2, Pi/2, Pi/24}]

Mathematica graphics

Effect of c in Manipulate is to change diameter of smallest circle of tangency for circle traversing disk. Slow step by step change of c works better to update plot. You can see effects by Manipulate slider e.g., swapping between c and a produces eccentric circles etc...

$\endgroup$

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.