AUTOCAD作图求助
现有一个问题,想用CAD作图求出来,可是本人水平太差,想不出来,在这请教各位大侠了!问题如下,已知弦的长度和弦所对圆弧的长度,如何在CAD里面通过作图求出圆的直径?见附件,直线长度知道,弧长知道,求半径。补充一点,条件是我们只知道直线长度和弧长。附件图形只是示意,不代表直线和圆弧已经连接到一块了,如果是那样的话,就太简单了,岂不是直接捕捉圆心也就出来了 此问题没有精确的计算公式.但是若弦长和弧长相差不大时,有个近似的公式:d=√(c^3/(c-a)/6),
(其中d是圆的直径,c是弧长,a是弦长)
若要较精确的数值,请给出具体数值来吧,我可以帮你算算. 设m为弦长、n为弧长,R为半径(待求);
设圆心角为α,那么n=αR,即α=n/R;
又m=2R.sin(α/2)
即m=2R.sin(n/(2R))
用叠代法就可以求出R的数值解。
建议在excel中求。
本帖最后由 qjchen 于 2011-3-19 16:38 编辑
:) 此题确实是得用数值解法了
根据chenjun兄的解法,采用以前的二分法lisp编了一段LISP,不过最后是画出圆而没有画出弧
;;; By qjchen@gmail.com
;;; The main code mainly from the MIT book "Structure and interpretaion of computer programs"
;;; judge whether the initial range is suitable
(defun halfsolve (f a b / a-value b-value)
(setq a-value ((eval f) a)
b-value ((eval f) b)
)
(cond
((and (< a-value 0) (> b-value 0)) (searchhalf f a b))
((and (> a-value 0) (< b-value 0)) (searchhalf f b a))
((= a-value 0) a)
((= b-value 0) b)
(T (prompt "The Values maybe not between a and b"))
)
)
;;core code of dichotomy
(defun searchhalf (f neg-point pos-point / test-value midpoint)
(setq midpoint (/ (+ neg-point pos-point) 2))
(cond
((close-enough? neg-point pos-point) midpoint)
(T
(setq test-value ((eval f) midpoint))
(cond
((> test-value 0) (searchhalf f neg-point midpoint))
((< test-value 0) (searchhalf f midpoint pos-point))
(T midpoint)
)
)
)
)
;;judge small enough
(defun close-enough? (x y)
(< (abs (- x y)) 1e-10)
)
;; The equation to be solve, -x^3+2x+3=0
;;2*x*sin(arcl/2/x)-linel
(defun myfuntosolve (x)
(- (* x 2.0 (sin (/ arclength 2. x))) linelength)
)
;;Main function by qjchen@gmail.com
(defun c:t( / a ang arclength d linelength p1 r)
(setq a (vlax-ename->vla-object (car (entsel "\n Please select a line"))) arclength (getreal "\n Arc Length"))
(setq linelength (Vlax-geta 'length))
(if (> arclength linelength)
(progn (princ (rtos (setq r (halfsolve myfuntosolve (/ linelength 2.0) (/ linelength 0.01))) 2 14))
(setq P1 (Vlax-geta 'StartPoint)
ang (Vlax-geta 'Angle)
d (sqrt (- (* r r) (* linelength linelength 0.25))))
(command "circle" (polar (polar P1 ang (* 0.5 linelength)) (+ ang (* 0.5 pi)) d) r)
(command "circle" (polar (polar P1 ang (* 0.5 linelength)) (+ ang (* 0.5 pi)) (- d)) r)
)
(princ "the Arc length is too small")
)
(princ)
)
这里真是高手如云!在一次计算盘梯的时候,最后归纳为这样一个问题!
在此非常感谢楼上各位不仅给出了思路,还给出了程序!非常感谢! 很诧异,就在原弧线上再任意画两条弦,然后分别做出中垂线,得到两垂线交点便是圆心了。
页:
[1]