Hi Alls,
This code still problem,especially in amplitude,I want result 3 but the fact only 0.8083,and this wave should be opposite to others,this code still monoton,sorry I got problem to post here with drawing
(defun c:freq (/ 1/2amp ad amp ang dis div freq p1 p2 p3 p4 px)
(setq freq (getreal "\nEnter frequency for this line<3>: "))
(if (= freq nil)(setq freq 3))
(setq amp (getreal "\nEnter amplitude for this line<6>: "))
(if (= amp nil)(setq amp 6))
(setq p1 (getpoint "\nClick for first point<0,0,0>: "))
(if (= p1 nil)(setq p1 '(0 0 0)))
(setq p2 (getpoint "\nClick for first point<36,0,0>: "))
(if (= p2 nil)(setq p2 '(36 0 0)))
(setq dis (distance p1 p2))
(setq div (/ dis amp))
(setq ang (angle p1 p2))
(setq 1/2amp (/ amp 2.0))
(setq px p1)
(repeat
(fix div)
(setq p3 (polar px ang 1/2amp))
(setq ad (getvar "angdir"))
(if (= ad 0)(setvar "angdir" 1))
(command "arc" px "e" p3 "r" freq "")
(setq p4 (polar px ang 1/2amp))
(setq ad (getvar "angdir"))
(if (= ad 1)(setvar "angdir" 0))
(command "arc" px "e" p3 "r" freq "")
(setq px p4)
) ; repeat
(princ)
)