Python语言 - 使用turtle模块
```python
import turtle
创建一个画布和海龟对象
canvas = turtle.Screen()
turtle = turtle.Turtle()
设置海龟的形状和颜色
turtle.shape("turtle")
turtle.color("blue")
设置圆的半径和颜色
radius = 100
circle_color = "red"
绘制圆形
turtle.fillcolor(circle_color)
turtle.begin_fill()
turtle.circle(radius)
turtle.end_fill()
隐藏海龟
turtle.hideturtle()
关闭画布
canvas.exitonclick()
```
Python语言 - 使用matplotlib库
```python
import matplotlib.pyplot as plt
import numpy as np
def plot_circle(center, radius):
theta = np.linspace(0, 2 * np.pi, 100)
x = center + radius * np.cos(theta)
y = center + radius * np.sin(theta)
plt.plot(x, y, color='blue')
圆心坐标和半径
center = (0.5, 0.5)
radius = 0.2
绘制圆形
plot_circle(center, radius)
显示图形
plt.axis('scaled')
plt.show()
```
C语言 - 使用EasyX图形库
```c
include
int main() {
// 初始化图形模式
initgraph(640, 480);
// 画一个圆
circle(320, 240, 100);
// 刷新屏幕显示
getch();
closegraph();
return 0;
}
```
HTML/CSS
```html