Jump to content

define arc of circle with Specified radius & Length & Central angl?


Recommended Posts

Posted

hi every body

i need one command that can drawing arc of circle with given length, radius, central angle, whether exist this command in autolisp or visual lisp? i expressed my mean in below figure.

please help me

2015-02-26_123410.jpg

Posted

commandline

Command: arc

ARC Specify start point of arc or

: c

Specify center point of arc:

Specify start point of arc:

Specify end point of arc or [Angle/chord Length]: a

Specify included angle: 23

 

command or vl-cmdf


([color="blue"]command[/color] "arc" "c" [color="green"]Center StartPoint[/color] "a" [color="green"]degree[/color])

 

autolisp method:

([color="blue"]entmakex [/color] (list '(0 . "ARC")(cons 10 [color="green"]Center[/color])(cons 40 [color="green"]Radius[/color])(cons 50 [color="green"]StartAngle[/color])(cons 51 [color="green"]EndAngle[/color])))

 

GREEN TEXT is argument/variable can be replaced by input value or using functions: getpoint , getreal or getstring etc..

Posted (edited)

Interesting math problem. I don't know lisp, but if we set up those angled lines such that the bisector was vertical then those rays should be rotated by:

ACOS(d2/(2*rad1*SIN(ang4/2.0)))

Edited by SEANT
Changed from ASIN to ACOS
Posted
Interesting math problem.

 

Yes, it is quite easy to construct. But as the OP wanted a one button solution, I was keeping my head below the parapet. :lol:

Posted
Yes, it is quite easy to construct. But as the OP wanted a one button solution, I was keeping my head below the parapet. :lol:

 

There are old warriors. There are daring warriors. There are no daring, old warriors.

Posted

Something overlooked you have 3 variables but the d and the angle are independent only one can be used but op asked for all 3 only 1 solution as shown in image change angle d changes

Posted

I don't think the 2.1 (d2) is intended to be the chord. If it were the chord, then the ang4 and d2 could not vary.

 

I think d2 is the projection of the chord based on the rotation angle of the system. So, for instance, if d2 needed to be 1.5, the system would need further rotation.

 

Incidentally, my first equation did have the error of using ASIN instead of ACOS.

Projection.jpg

Posted

In another thread by the OP (since deleted), the central angle seemed to vary. The radius and two parallel vertical lines were constant. As the central angle could vary between 49.4584 degrees and 20.1573 degrees (approximately) I was wondering whether there would be further information.

 

But with the information in this thread, there is only one solution.

 

Not having access to Constraints, I wonder if there is an easy solution using them.

Posted
Interesting math problem. I don't know lisp, but if we set up those angled lines such that the bisector was vertical then those rays should be rotated by:

ACOS(d2/(2*rad1*SIN(ang4/2.0)))

 

Agreed - this was my derivation:

 

derivation.png

 

Though, there are of course 4 possible solutions - one of each quadrant of the circle.

Posted

A quickly-written LISP solution:

(defun c:myarc ( / a b c d r x )
   (initget 1025)
   (setq c (getpoint "\nSpecify center: "))
   (initget 1095)
   (setq r (getdist  "\nSpecify radius: " c))
   (initget 1027)
   (setq b (getangle "\nSpecify included angle: "))
   (initget 1093)
   (setq d (getdist  "\nSpecify horizontal distance: ")
         a (acos (/ d 2 r (sin (/ b 2))))
         x (/ pi 2)
   )
   (repeat 2
       (repeat 2
           (entmake
               (list
                  '(0 . "ARC")
                   (cons 10 c)
                   (cons 40 r)
                   (cons 50 (+ x a (/ b -2)))
                   (cons 51 (+ x a (/ b  2)))
               )
           )
           (setq a (- a))
       )
       (setq x (+ pi x))
   )
   (princ)
)

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

(defun acos ( x )
   (if (<= -1.0 x 1.0)
       (atan (sqrt (- 1.0 (* x x))) x)
   )
)

(princ)

Posted

Our derivation methods are pretty much identical. Diving into these kinds of problems helps prevent math skills from getting rusty. Rust never sleeps.:)

Posted

I couldn't agree more - it's reassuring to know that I haven't forgotten it all just yet ;)

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...