Jump to content

Arc angle from radius and chord length


David Bethel

Recommended Posts

Given the radius ( r ) and an arc and the length of a chord ( ab ), how to calculate the included angle ( acb ) of the arc?

 

I have got dig out some old school books 1 day.....

 

-David

arc.gif

Link to comment
Share on other sites

Maybe:

 

(defun ArcIncludedAngle ( rad len )
   (* 2. (asin (/ len (* 2. rad))))
)

;; ArcSine - Lee Mac
;; Args: -1 <= x <= 1

(defun asin ( x )
   (cond
       (   (< 1.0 (abs x))
           nil
       )
       (   (equal (abs x) 1.0 1e-
           (* x pi 0.5)
       )
       (   (atan x (sqrt (- 1.0 (* x x))))
       )
   )
)

ArcSine from here.

Edited by Lee Mac
Edited to calculated angle ACB
Link to comment
Share on other sites

I would have thought that the previous solution would give the angle DCB.

 

I reckon the angle ACB = 2 * arcsin ( c / 2*r ).

 

or perhaps I should retire gracefully :unsure:

 

 

P.S.This is no longer applicable as editing has been done

Edited by eldon
added P.S.
Link to comment
Share on other sites

Lee, I thought that I edited it to ACB before I hit the post bottom. ......

 

Looks like it should work. Thanks!

 

We are making the blue box knowing the width of the box and radius of the cylinder -David

ar-jb.jpg

jb.jpg

Link to comment
Share on other sites

Lee, I thought that I edited it to ACB before I hit the post bottom. ......

 

Looks like it should work. Thanks!

 

We are making the blue box knowing the width of the box and radius of the cylinder -David

 

I see, looks good David :thumbsup:

Link to comment
Share on other sites

Jack,

 

Thanks for the link.

 

We automate these kind of things on a regular basis. Sometimes I use them often, others sparingly. I'm not big into 1 off modeling. I like multiple product items.

 

(defun makeit (d x y z b l / r tz ia ia2 rx lx by ty a i
                            il ir ib it iy bn)

(setq r (* d 0.5)
    tz (+ b z))

(defun ArcIncludedAngle ( rad len )
   (* 2 (asin (/ len (* 2. rad)))))

;; ArcSine - Lee Mac
;; Args: -1 <= x <= 1

(defun asin ( x )
   (cond ((< 1.0 (abs x)) nil )
         ((equal (abs x) 1.0 1e-
          (* x pi 0.5))
         ((atan x (sqrt (- 1.0 (* x x)))))))


(setq ia (ArcIncludedAngle r x))
(setq ia2 (* ia 0.5))

(entmake (list (cons 0 "BLOCK")(list 10 0 0 0)(cons 2 "*U")(cons 70 1)))

;;;REAR ARC
(entmake (list (cons 0 "ARC")(cons 8 l)
              (list 10 0 0 b)
              (cons 39 z)
              (cons 40 r)
              (cons 50 (- (* pi 0.5) ia2))
              (cons 51 (+ (* pi 0.5) ia2))))

(setq rx (car (polar '(0 0) (- (* pi 0.5) ia2) r))
     lx (- rx)
     by (cadr (polar '(0 0) (- (* pi 0.5) ia2) r))
     ty (+ by y))

(if (<= ty r)
   (alert "The Box Is Not Deep F-B Enough"))

;;;SIDES
(entmake (list (cons 0 "3DFACE")(cons 8 l)
               (list 10 rx by b)
               (list 11 rx ty b)
               (list 12 rx ty tz)
               (list 13 rx by tz)))
(entmake (list (cons 0 "3DFACE")(cons 8 l)
               (list 10 lx by b)
               (list 11 lx ty b)
               (list 12 lx ty tz)
               (list 13 lx by tz)))

;;;TOP AND BOTTOM FILLERS
(setq a (- (* pi 0.5) ia2)
     i (/ (* ia2 2) )

(repeat 8
 (entmake (list (cons 0 "3DFACE")(cons 70 15)(cons 8 l)
                (list 10 (if (< a (- (* pi 0.5) 0.01)) rx lx) ty b)
                (cons 11 (polar (list 0 0 b) a r))
                (cons 12 (polar (list 0 0 b) (+ a i) r))
                (list 13 (if (< a (- (* pi 0.5) 0.01)) rx lx) ty b)))
 (entmake (list (cons 0 "3DFACE")(cons 70 15)(cons 8 l)
                (list 10 (if (< a (- (* pi 0.5) 0.01)) rx lx) ty tz)
                (cons 11 (polar (list 0 0 tz) a r))
                (cons 12 (polar (list 0 0 tz) (+ a i) r))
                (list 13 (if (< a (- (* pi 0.5) 0.01)) rx lx) ty tz)))
 (setq a (+ a i)))

(entmake (list (cons 0 "3DFACE")(cons 70 15)(cons 8 l)
              (cons 10 (polar (list 0 0 b) (* pi 0.5) r))
              (list 11 rx ty b)
              (list 12 lx ty b)
              (cons 13 (polar (list 0 0 b) (* pi 0.5) r))))
(entmake (list (cons 0 "3DFACE")(cons 70 15)(cons 8 l)
              (cons 10 (polar (list 0 0 tz) (* pi 0.5) r))
              (list 11 rx ty tz)
              (list 12 lx ty tz)
              (cons 13 (polar (list 0 0 tz) (* pi 0.5) r))))

;;;FRONT FACE
(setq iy (- ty 1)
     il (+ lx 0.25)
     ir (- rx 0.25)
     ib (+ b 0.25)
     it (+ b z -0.25))

;;;FLAT COVER BOX
;(entmake (list (cons 0 "3DFACE")(cons 8 l)
;               (list 10 lx ty b)
;               (list 11 lx ty tz)
;               (list 12 rx ty tz)
;               (list 13 rx ty b)))

;;;INSERT BOX
(entmake (list (cons 0 "3DFACE")(cons 8 l)
              (list 10 il iy ib)
              (list 11 il iy it)
              (list 12 ir iy it)
              (list 13 ir iy ib)))
(entmake (list (cons 0 "3DFACE")(cons 8 l)
              (list 10 il iy ib)
              (list 11 il iy it)
              (list 12 il ty it)
              (list 13 il ty ib)))
(entmake (list (cons 0 "3DFACE")(cons 8 l)
              (list 10 ir iy ib)
              (list 11 ir iy it)
              (list 12 ir ty it)
              (list 13 ir ty ib)))
(entmake (list (cons 0 "3DFACE")(cons 8 l)
              (list 10 il iy ib)
              (list 11 il ty ib)
              (list 12 ir ty ib)
              (list 13 ir iy ib)))
(entmake (list (cons 0 "3DFACE")(cons 8 l)
              (list 10 il iy it)
              (list 11 il ty it)
              (list 12 ir ty it)
              (list 13 ir iy it)))

(entmake (list (cons 0 "3DFACE")(cons 8 l)
              (list 10 il ty ib)
              (list 11 il ty it)
              (list 12 lx ty tz)
              (list 13 lx ty b)))
(entmake (list (cons 0 "3DFACE")(cons 8 l)
              (list 10 ir ty ib)
              (list 11 ir ty it)
              (list 12 rx ty tz)
              (list 13 rx ty b)))
(entmake (list (cons 0 "3DFACE")(cons 8 l)
              (list 10 ir ty ib)
              (list 11 il ty ib)
              (list 12 lx ty b)
              (list 13 rx ty b)))
(entmake (list (cons 0 "3DFACE")(cons 8 l)
              (list 10 ir ty it)
              (list 11 il ty it)
              (list 12 lx ty tz)
              (list 13 rx ty tz)))

(setq bn (entmake (list (cons 0 "ENDBLK")(cons 8 "0"))))
(entmake (list (cons 0 "INSERT")(cons 2 bn)(cons 8 "0")(list 10 0 0 0)))

(prin1))

;++++++++++++ Get It Then Make It +++++++++++++++++++++++++++++++++++++
(defun c:getit (/ dia wid dep hgt bot clr lay)

(initget 7)
(setq dia (getdist "\nArc Diameter:   "))

(initget 7)
(setq wid (getdist "\nBox Width S-S:   "))

(initget 7)
(setq dep (getdist "\nBox Depth F-B:   "))

(initget 7)
(setq hgt (getdist "\nBox Height T-B:   "))

(initget 5)
(setq bot (getdist "\nBox Bottom Elevation:   "))

(initget "Sst Gray BLack blUe")
(setq clr (getkword "\nBox Color- Sst/Gray/BLack/blUe:   "))
(setq lay (strcat "3D" (cond ((not clr) "")
                            ((= clr "Sst") "")
                            (T (strcat "-" (strcase clr))))))

(makeit dia wid dep hgt bot lay)
(entlast))

ar-tboc.jpg

Link to comment
Share on other sites

Jack,

 

Thanks for the link.

 

You're welcome!

 

Almost every thing I do is a 1-off. The bulk of my work is commercial curtain wall, and although many times they use the same extrusions, each building is an individual. You might think that they look the same on the outside, but with different wind loads and construction techniques they are all different.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...