(defun asin (x0 y0 r)
(setq dt (/ pi 36) tt 0 any (* 2 pi)) (command \"pline\") (while (<= tt any)
(setq x1 (+ x0 (* r (- tt (sin tt))))) (setq y1 (+ y0 (* r (- 1 (cos tt))))) (command (list x1 y1)) (setq tt (+ tt dt)) ) (command)
(command \"pedit\" \"l\" \"f\" \"\") (command \"redraw\") )
) )
截图:
S5-11:绘制渐开线,只画曲线,a单位的为度。渐开线标准方程: X=r*( Y=r*(
+t-t
) )
程序编写如下:
(defun Jkx (x0 y0 a r l)
(if ( < a 0 )(setq a (+ a 360))) (setq dt (/ pi 36) tt 0 any (* a l))
(setq a (* a (/ pi 180)) any (* any (/ pi 180))) (setq si (sin a)) (setq cs (cos a)) (command \"pline\") (while (<= tt any) (setq x1 (* r (+ (cos tt) (* tt (sin tt))))) (setq y1 (* r (- (sin tt) (* tt (cos tt))))) (setq x (+ x0 (- (* x1 cs) (* y1 si)))) (setq y (+ y0 (+ (* x1 si) (* y1 cs)))) (command (list x y)) (setq tt (+ tt dt)) ) (command) (command \"pedit\" \"l\" \"f\" \"\") (command \"redraw\") )
截图:
S5-12:绘制正弦曲线y=a*sin(x+φ),参数表(x0 y0 a t1 ph) 程序:
(defun aasin (x0 y0 a t1 ph)
(setq dt (/ pi 36) tt 0 ph (* ph (/ pi 180))) (setq p0 (list x0 y0)) (command \"pline\") (while (<= tt t1)
(setq b (+ (* (/ (* 2 pi) t1) tt) ph)) (setq y1 (+ y0 (* a (sin b)))) (command (list (+ x0 tt) y1)) (setq tt (+ tt dt)) )
(command)
(command \"pedit\" \"l\" \"f\" \"\") )
截图: (0 0 100 360 40)
S5-13: 程序:
(defun juxing (x0 y0 d0 a dmin) (setq p0 (list x0 y0)) (setq a (* a(/ pi 180))) (while(<= dmin d0)
(command \"polygon\" 4 p0 \"i\" (polar p0 a d0)) (setq d0 (/ d0 (sqrt 2))) (setq a (+ a (/ pi 4))) ) )
截图: (0 0 100 30 20)
S5-14: 程序:
(defun mgui (x0 y0 am d n) (repeat n
(setq dt (/ pi 36) tt 0 any (* 2 pi)) (setq p0 (list x0 y0)) (command \"pline\") (while (<= tt any)
(setq p1 (polar p0 tt (* am (sin (* 2 tt))))) (command p1) (setq tt (+ dt tt)) )
(command (polar p0 any (* am (sin (* 2 pi))))) (command)
(command \"pedit\" \"l\" \"f\" \"\") (setq am (+ am d)) )
(command \"redraw\") )
截图: (150 180 60 20 5)
S-15: 程序:
(defun f (x1 y1 a)
(setq dt (/ pi 36) tt 0 any (* 2 pi)) (setq p0 (list x1 y1)) (command \"pline\") (while (<= tt any)
(setq p1 (polar p0 tt (* a (sin (* 2 tt))))) (command p1) (setq tt (+ dt tt)) )
(command (polar p0 any (* a (sin (* 2 pi))))) (command)
(command \"pedit\" \"l\" \"f\" \"\") )
(defun mgui2 (x0 y0 am d n) (setq x1 x0 y1 y0 a am) (repeat n (f x1 y1 a) (setq a (+ a d)) )
(command \"redraw\") )
截图:(150 180 60 20 5)
S-17: 程序:
(defun zliu (x0 y0 r0 sr a da n) (setq x1 x0 y1 y0 r r0 n1 6 a1 a) (setq da (* da (/ pi 180))) (setq a1 (* a1 (/ pi 180))) (repeat n
(setq p0 (list x1 y1)) (setq p1 (polar p0 a1 r))
(command \"polygon\" n1 p0 \"i\" p1) (setq r (+ r sr)) (setq a1 (+ a1 da)) )
(command)
(command \"redraw\") )
截图:(0 0 20 5 30 15 15)
因篇幅问题不能全部显示,请点此查看更多更全内容