 - (defun c:inv (/ xmin xmax n dx h x0 y0 x1 y1)
- (defun dtor (d) (/ (* d pi) 180))
- (setq xmin (getreal "\n 输入起始角:"))
- (setq xmax (getreal "\n 输入终止角:"))
- (setq dx (getreal "\n 输入角度增量:"))
- (setq h (getreal "\n输入幅值:"))
- (setq n (fix (/ (- xmax xmin) dx)))
- (setq dx (/ (- xmax xmin) n))
- (setq x0 xmin)
- (setq y0 (* (sin (dtor x0)) h))
- (command "_.PLINE" "non" (list x0 y0))
- (while (<= x0 xmax)
- (setq x1 (+ x0 dx))
- (setq y1 (* (sin (dtor x1)) h))
- (command "non" (list x1 y1))
- (setq x0 x1)
- )
- (command "")
- (princ)
- )
|