3
$\begingroup$

A point is on one side of a regular polygon, and the regular polygon rotates at a constant speed. How can I draw the change curve of the vertical coordinate of the point with time?

enter image description here

$\endgroup$
4
  • 2
    $\begingroup$ I think the equation of each closed curve (well, each polygon) in the planar polar coordinate system $ \rho = \rho(\phi) $ will help much. $\endgroup$ Commented Feb 24, 2020 at 8:20
  • 1
    $\begingroup$ related: this and this $\endgroup$
    – kglr
    Commented Feb 24, 2020 at 10:31
  • 1
    $\begingroup$ @Αλέξ, luckily this has been done. $\endgroup$ Commented Apr 25, 2020 at 11:00
  • $\begingroup$ @J.M. Thx for the information! $\endgroup$ Commented Apr 25, 2020 at 11:03

1 Answer 1

3
$\begingroup$

How it exactly should rotate is not clear to me (still image), but here is my interpretation of doing it:

ClearAll[func,regpolygon]
func[θ_]:={Cos[θ],Sin[θ]}
regpolygon[n_][θ_]:=func[θ] Cos[Pi/n]/Cos[(2Pi)/n ((θ n)/(2Pi)-Floor[(θ n)/(2Pi)])-Pi/n]
MakeScene[θ_,f_]:=Module[{plog,t,p1,pt0,pt1,pt2},
plog=ParametricPlot[f[t]-{1,0},{t,0,2Pi},PlotStyle->Red];
pt0={-1,0};
pt1=f[θ]-{1,0};
pt2={0,f[θ][[2]]};
p1=Plot[f[t+θ][[2]],{t,0,2Pi},PlotRange->{{-2.1,2Pi},{-1.05,1.05}},AspectRatio->Automatic,Epilog->{Red,Line[{pt0,pt1,pt2}],Point[{pt0,pt1,pt2}]},PlotStyle->Red];
Show[{p1,plog}]
]
Manipulate[MakeScene[t,regpolygon[n]],{{n,5},3,10,1},{t,0,2Pi}]

enter image description here

$\endgroup$

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.