Mathematica基础——续谈AnglePath

2026-02-18 23:55:50

1、路径连续转动3次120°,就是一个正三角形。

Graphics[Line[AnglePath[Table[2 Pi/3,3]]]]

Mathematica基础——续谈AnglePath

2、用动态效果展示上面这个正三角形的绘制过程:

Manipulate[Graphics[Line[AnglePath[Table[2 Pi/3,n]]]] ,{n,1,3,1}]

Mathematica基础——续谈AnglePath

3、用动态图展示正七边形:

Manipulate[

   Graphics[Line[AnglePath[Table[2 Pi/7,n]]],

        PlotRange->{{-1.5,0.5},{0,2.2}},Axes->True] ,{n,1,7,1}]

Mathematica基础——续谈AnglePath

4、绘制一个正五角星:

Manipulate[

   Graphics[Line[AnglePath[Table[4 Pi/5,n]]],

        PlotRange->{{-1.1,0},{-0.4,0.6}},Axes->True] ,{n,1,5,1}]

Mathematica基础——续谈AnglePath

5、绘制几个精彩的“路径”图片:

r[p_,q_]:=Graphics[Line[

       AnglePath[Table[{r,p},{r,0,1,q}]]]]

r[119.09°,0.01]

r[119.01 Degree,0.005]

r[102.07 Degree,0.005]

r[102.67 Degree,0.005]

Mathematica基础——续谈AnglePath

Mathematica基础——续谈AnglePath

Mathematica基础——续谈AnglePath

Mathematica基础——续谈AnglePath

猜你喜欢