导入turtle库
```python
import turtle
```
定义绘制五角星的函数
```python
def draw_star(x0, y0, r):
turtle.penup()
turtle.goto(x0, y0 - r)
turtle.pendown()
for i in range(5):
turtle.goto(x0 + r * cos(2 * i * π / 5), y0 - r * sin(2 * i * π / 5))
```
设置初始位置和半径
```python
x0 = 0
y0 = 0
r = 100
```
调用绘制函数
```python
draw_star(x0, y0, r)
```
完成绘图
```python
turtle.done()
```
将以上代码放在一起,完整的程序如下:
```python
import turtle
def draw_star(x0, y0, r):
turtle.penup()
turtle.goto(x0, y0 - r)
turtle.pendown()
for i in range(5):
turtle.goto(x0 + r * cos(2 * i * π / 5), y0 - r * sin(2 * i * π / 5))
x0 = 0
y0 = 0
r = 100
draw_star(x0, y0, r)
turtle.done()
```
运行这段代码,将会绘制出一个以原点为圆心,半径为100的五角星。你可以根据需要调整`x0`、`y0`和`r`的值来改变五角星的位置和大小。