parent
b15811e3da
commit
721e5b5720
Binary file not shown.
Binary file not shown.
@ -0,0 +1,20 @@
|
||||
# pip install geogebra-ggb-api-python
|
||||
|
||||
from pygeogebra import GeoGebra
|
||||
|
||||
# 创建实例
|
||||
ggb = GeoGebra()
|
||||
|
||||
# 绘制点、线、圆
|
||||
point_A = ggb.add_point("A", (0, 0))
|
||||
point_B = ggb.add_point("B", (2, 1))
|
||||
line_AB = ggb.add_line("AB", point_A, point_B)
|
||||
circle = ggb.add_circle("Circle", point_A, 3)
|
||||
|
||||
# 添加动态滑块
|
||||
slider = ggb.add_slider("k", 0, 5, 1)
|
||||
dynamic_point = ggb.add_point("P", (slider, slider**2)) # 抛物线上的点
|
||||
|
||||
# 导出为HTML或PNG
|
||||
ggb.export("figure.html") # 交互式网页
|
||||
ggb.export("figure.png", dpi=300) # 静态图片
|
Loading…
Reference in new issue