sine.py

来自「qcad2.05可用于windows和linux的源码」· Python 代码 · 共 24 行

PY
24
字号
import qcadimport mathdef start(str):	n=0        # counter	res=32     # resolution of sin		# x-axis:	qcad.rsPyAddLine(0, 0, 2*math.pi, 0)	while n<2*math.pi:		qcad.rsPyAddLine(n, 0, n, -0.05)		n+=math.pi/4	# y-axis:	qcad.rsPyAddLine(0, -1, 0, 1)	# sinus	n=0.0	step=(2*math.pi)/res	while n<2*math.pi:		qcad.rsPyAddLine(n, math.sin(n), n+step, math.sin(n+step))		n+=step	return(1)

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?