From 6114@dktc11.BITNET Tue Feb  7 22:48:10 1989
Received: by korppi.tut.fi (4.0/10.6.master) id AA13124; Tue, 7 Feb 89 22:48:08 +0200
Message-Id: <8902072048.AA13146@kaarne.tut.fi.tut.fi>
From: 6114@dktc11.BITNET
Received: by fintut Tue Feb  7 22:48:19
	from mailer@ohstvma.BITNET via Urep 3.2 PUNCH.
Received: by OHSTVMA (Mailer X1.25) id 5816; Tue, 07 Feb 89 15:32:25 EST
Date:         Tue, 7 Feb 89 15:31:50 EST
Reply-To: AUTOCAD Autocad Discussion List <AUTOCAD@OHSTVMA>
Sender: AUTOCAD Autocad Discussion List <AUTOCAD@OHSTVMA>
X-Original-From: 6114@DKTC11
To: jja@fintut.BITNET
X-Original-To: jari ahola <jja@fintut> 

;	FILE: SINUS.LSP
;       (setq programmer "Hans Ostergard <6114@DKTC11>")
;       (setq date "880606")
;       (if (= question why?) (prompt "he likes pretty curves"))
;       describe see end of file
(defun cequa (xvar Endp Grow / tp ntimes bs cs)
        (setq cs (getvar "cmdecho"))
        (setq bs (getvar "blipmode"))
        (setvar "blipmode" 0)
        (setvar "cmdecho" 0)
	(setq ntimes (fix (abs (/ (- Endp xvar) Grow))))
        (prompt (strcat "number of lines : " (itoa ntimes)))
        (command "pline" (list xvar 0))
	(setq xvar (- xvar Grow))
        (repeat ntimes
              (setq tp (list (setq xvar (+ xvar Grow))
                             (sin (* xvar 2)) ))
;look-out, function is:   f(x) = sin(2x)
              (command tp)
        )
        (command)
        (setvar "blipmode" bs)
        (setvar "cmdecho" cs)
        nil
)
;
;       Interactive equation generation
;
(defun C:sinus ( / sp ep gr)
        (prompt "\nStart point: (try -1) ")
        (setq sp (getreal))
        (prompt "\nEnd point: (try 3.14) ")
        (setq ep (getreal))
        (prompt "\nGrowth, less than End-Start: (try 0.1) ")
        (setq gr (getreal))
        (cequa sp ep gr)
)
;This is an interactive function generator for autocad.
;To run this, start autocad, begin a new file, and when the
;prompt comes, type:
;COMMAND>(load"sinus")
;and then:
;COMMAND>SINUS
;the program SINUS will ask some questions
;
;this demo will draw f(x) = sin(x*2)
;If you want to make another equation, you have to learn a little
;about AutoLisp-programming.
;sin(x*2) is: (sin (* xvar 2)) ))
;sin(x*x) is: (sin (* xvar xvar)) ))
;sin(x*3-2) is: (sin (- (* xvar 3) 2))) ))
;..and so on. Look in the referenceguide for more details.
;
;But why using this? I already got MathCad or something you said.
;Because with AutoCad's function PEDIT you can fit the curve,
;and make an extremly smooth curve. And add text,boxes,more curves,
;lines, circles and what so ever.
;Some firms offer you electrostatic plots of your AutoCad drawings,
;maybe expenceive, but pretty.
;
;Cut this text to an other file, or delete it. AutoCad don't likes
;hugh lispfiles.
;Hans Ostergard, 6114\DKTC11, Denmark


