View Full Version : Calculate a curve?
smiller352220
2004-06-21, 06:06 PM
Dose anyone have a lisp or a calc. program that will give you curve data by entering 2 items of the curve like the Delta and Chord Length? Any help would be grateful!
paulmcz
2004-06-22, 12:07 AM
...what kind of a curve?
smiller352220
2004-06-22, 12:30 PM
Standard curve......just looking for a cogo calc program that will give you the curve data like if you enter the chord length and the delta it should give you the radius, etc........
peter
2004-06-22, 12:43 PM
Maybe?
(defun C:CurveData ()
(setq sngChordLength (getdist "\nEnter ChordLength: ")
sngDeltaAngle (* pi (/ (getdist "\nEnter Delta Angle in Degrees: ") 180.0))
sngRadius (/ sngChordLength
2.0
(sin (/ sngDeltaAngle 2.0))
)
)
)
stig.madsen
2004-06-22, 12:57 PM
Oh, a standard curve is a circular curve?
Here's one with chord lenght and arc height:
(defun C:ARCC (/ ch s ch2 ang)
(and (setq ch (getdist "\nChord length: "))
(setq s (getdist "\nArc height: "))
(setq ch2 (/ ch 2.0))
(mapcar 'princ (list "\nIncluded angle = " (setq ang (* 4.0 (atan (/ s ch2))))
" rad (" (* (/ 180.0 pi) ang) " deg)\nRadius = "
(/ (+ (expt ch2 2.0) (expt s 2.0)) (* 2.0 s))))
)
(princ)
)
... or to draw it:
(defun C:ARCH (/ p1 p2 s ch2 angr angd rad)
(cond ((and (setq p1 (getpoint "\nChord start point: "))
(setq p2 (getpoint p1 "\nChord end point: "))
(not (equal p1 p2))
(setq s (getdist
(mapcar (function (lambda (m n) (/ (+ m n) 2.0))) p1 p2)
"\nHeight of arc: "
)
)
)
(setq ch2 (/ (distance p1 p2) 2.0)
angr (* 4.0 (atan (/ s ch2)))
angd (* (/ 180.0 pi) angr)
rad (/ (+ (expt ch2 2.0) (expt s 2.0)) (* 2.0 s))
)
(command "ARC" p1 "E" p2 "A" angd)
(princ (strcat "\nRadius: " (rtos rad)))
)
)
(princ)
)
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.