Jump to content

Recommended Posts

Posted

Hi

Thanks for sharing your knowledge. I was wondering if it would be difficult to get chords of two or three different lengths on the same arc.

Posted

If the arc exists then you can use DIVIDE it will put points on the arc, set PDMODE 34, then just use pline to join picking the nodes use OSMODE 8 for snap setting.

Posted

@Vica 

The routine I posted here takes a quantity and length of chord and calculates the radius for a specific arc length.

So for THAT radius and arc length you can only specify a number chords.  The length of the chords will be determined by the length of the arc.  Following the method provided by @BIGAL you start with an arc of given radius then specify the quantity of chords; the length of chord is whatever the math provides.

For a given radius and arc length you cannot specify both quantity AND length of chords.

From your post I am not sure what you mean by "two or three different lengths".  A sketch would be nice.  If you mean the first chord would be x long and the next chord would be y long etc continuing to the end of the arc with the last chord  being whatever remained then a routine could be written.

To answer your question whether it would be " difficult" :  For me it would be a challenge but to the better programmers on this site it may be straight forward.

 

 

Posted
14 hours ago, JerryFiedler said:

@Vica 

The routine I posted here takes a quantity and length of chord and calculates the radius for a specific arc length.

So for THAT radius and arc length you can only specify a number chords.  The length of the chords will be determined by the length of the arc.  Following the method provided by @BIGAL you start with an arc of given radius then specify the quantity of chords; the length of chord is whatever the math provides.

For a given radius and arc length you cannot specify both quantity AND length of chords.

From your post I am not sure what you mean by "two or three different lengths".  A sketch would be nice.  If you mean the first chord would be x long and the next chord would be y long etc continuing to the end of the arc with the last chord  being whatever remained then a routine could be written.

To answer your question whether it would be " difficult" :  For me it would be a challenge but to the better programmers on this site it may be straight forward.

 

 

Hello

I was wondering if it was possible to adapt the code with minor modifications so that it could calculate chords of 2 or 3 different lengths on the same arc. The calculated arc length will have to be adjusted to the sum of the chord lengths, of course. But this is always the case, in all cases.

 

Thanks anyway for sharing your knowledge ☺️

Posted
3 hours ago, Vica said:

Hello

I was wondering if it was possible to adapt the code with minor modifications so that it could calculate chords of 2 or 3 different lengths on the same arc. The calculated arc length will have to be adjusted to the sum of the chord lengths, of course. But this is always the case, in all cases.

 

Thanks anyway for sharing your knowledge ☺️

 

As the original equation was based on the geometrical fact that the supplement of the internal included angle of two intersecting lines was directly proportional to the number of equal chords, then the answer is no.

 

Different chords are not directly proportional to the subtended angles. There is a trigonometrical calculation involved.

 

So, the answer to your question is that the code would have to be completely rewritten. But I cannot envisage the circumstance where chords of differing lengths would be required. Perhaps you would give a drawing of such a requirement?

Posted

@Vica

As @eldon pointed out, the program in this thread cannot have multiple length chords. The geometry is a unique solution of a given number of equal length chords. The result is a specific length arc with a specific radius.

In your post above you write "2 or 3 different lengths on the same arc."  In the next sentence you write "The calculated arc length will have to be adjusted...".  If you " adjust" the arc length then it is not the "same" arc.

I want to help you but I don't understand your goal.  A sketch or drawing would help.

Posted

@Vica

 

Perhaps you should try parametric constraints as suggested by @LanloyLisp

Posted

Chords of different lengths on the same arc?
What's the point of that?

Posted

Anyway, I think it should be possible to write code that works in all cases.

Posted

A multi chord different sizes is feasible provided you have an existing arc, you draw a new arc from start point of chord length, then use Intersectwith to get a end point. Repeat as required if point past end then say so. Note in image the small cyan line is balance length. 

 

image.png.abc645e2a616c7852c89cc52de16e31d.png

Posted

Do you have many like this to draw or is it a case of "looks interesting for later"?

 

To draw one off, you must try parametric constraints.

Posted

One of those values is in correct in image, it would be a miracle to use the values shown it would only match a certain combination of arc radius and internal angle. 

 

If you look at the code by Eldon about chord length it uses an angle, in your image you have 3 angles, 2xang1+ 2xang2+ang3= internal angle, so you have 3 unknowns to solve, I don't think you can solve the angles.

Posted (edited)

@BIGAL

You are correct the total angle of the arc is known, call it X, since we know the angle between the intersecting lines.  You are also correct that the total angle is 2xang1+2xang2+ang3 and this equals pi - X.  However, we can solve for the angles. I was working on the formulas this afternoon but did not finish. (Have to eat, sleep etc...).  You must first calculate the proportions of the chords to the total length of chords.  For the example given 5m , 3m and 2m the proportions are 0.277777, 0.166666, 0.11111.  You can check that 2xfirst+2xsecond+third =1.00000.

It is important to keep in mind that the radius is the same for every chord.  If we say A is the total angle of the total arc we can solve for r, the radius of the arc.  Chord1 = 5 = 2 * r * sin((0.277777 * A) / 2).  Solving for r we know everything about the arcs and angles.  We now have all arc lengths 1,2, and 3 so we can determine the points along the total arc where the chords intersect. Once we have the points we can simply create a polyline to show the chords.

Tomorrow if I find some free time I will write some lisp code.

 

Edited by JerryFiedler
Changed to * for multiplication symbol in formula.
Posted
7 hours ago, JerryFiedler said:

 

...........You must first calculate the proportions of the chords to the total length of chords..........

 

 

I am not sure that this statement can be also applied to the angles subtended by each chord. It is like saying that the chord lengths are proportional to the arc lengths. There is clearly some other factor being introduced.

 

I tried to prove my thoughts in the accompanying picture, I first took an arc (any arc will do because if it works for one then it will work for all).

I divided the arc into 18 and took the chord lengths as the number of divisions as the chord length, i.e.5 divisions for the 5 chord, etc

Then I scaled everything so that the 5 chord was exactly 5 units long. I measured the 2 chord and it was not 2, but 2.039404.

So I think the problem of calculating the radius for differing chord lengths cannot be done by simple proportions.

 

 

Chords-various.PNG

Posted

@eldon You said "any arc will do".  To my thinking that is not true. There is one an only one arc with a subtended angle A and chords with the given lengths. Later today I will develop my thoughts further and either prove it or not. Each segment's angle, chord and arc length are all proportional to one another and they all have the same radius.

Posted
56 minutes ago, JerryFiedler said:

@eldon You said "any arc will do".  To my thinking that is not true. There is one an only one arc with a subtended angle A and chords with the given lengths. Later today I will develop my thoughts further and either prove it or not. Each segment's angle, chord and arc length are all proportional to one another and they all have the same radius.

 

I was trying to prove or disprove a contention that the angle, chord and arc length are linearly proportional, so I was taking an arc at random and not using a specifically chosen one. I think that my findings do cast doubt on equal proportions.

 

When one examines the arc to chord ratio, the expression involves a trigonometric expression. The only factor involved is the angle. The radius appears on both side of the equation and so cancels out. The included angle is the only variable. The closer the angle is to zero, the nearer the chord length equals the arc length. When the angle is 180, then the chord length is the diameter and the arc length is half the circumference. But the rate of change between these limits is not linear.

 

When the chords were equal, as in the original thread, there were linear proportions, but different length chords complicate matters. Undoubtedly equations can be written, but they would be far beyond my ability and I look forward to your efforts. But do not take that as a challenge!

Posted

Thanks for the answers.

@BIGAL The image I attached is a freehand drawing to help understand my question. The lengths are rounded, but my common sense tells me it should be possible to calculate that combination of chords or any other.

@eldon I've considered a solution like this several times, but I finally opted for simpler ones that are within my reach.
A tool like this could be useful for future users of this forum.

Posted

@eldon Yes, you are correct.  Upon further study I now realize the chords are not linearly proportional to their angle.  The arc lengths are proportional but they don't help with the solution.  Since the chord length is 2 * r * sin(ang/2) the out-of-balance, if you will, is related to the sine function.  So the cords are not linearly proportional but related to the sine.  Hmm. This requires some more thought. You said I should not take your comments as a challenge.  I'm retired and this forum gives my brain exercise!  Hopefully we can all help to get @Vica a useful tool.

Posted

Your comments explain why this code has a misclose. If you run it you will get a radius, use say 5 3 2 3 5. Then draw a 5 circle on ends then a 3 circle on intersection with arc both sides the gap is not 2.000 but close. Just test code. maybe need to add in Arclen = RAD * angle in radians so some form of scale factor comparing total chord length to arc length just a guess.

 

(defun angle-between-lines (pt1 pt2 pt3 / )
(setq ang1 (angle end1 apex))
(setq ang2 (angle apex end2))
(setq ang (abs (- ang1 ang2)))
(if (> ang pi)(setq ang (- ang pi)))
)

(setq lst '())
(setq chs "")
(while (setq newch (getreal (strcat "\nPlease enter chord values " chs " Enter to stop ")))
(setq lst (cons newch lst))
(setq chs (strcat chs (rtos newch 2 3) " "))
)

(setq sum (apply '+ lst))
(setq propval (/ (car lst) sum))

; Select lines.
  (setq ent1 (car (entsel "\nPick Line 1 ")))
  (setq ent2 (car (entsel "\nPick Line 2 ")))
; Get end points of selected lines.
  (setq obj1 (vlax-ename->vla-object ent1))
  (setq obj2 (vlax-ename->vla-object ent2))
  (setq p1 (vlax-get obj1 'startpoint))
  (setq p2 (vlax-get obj1 'endpoint))
  (setq p3 (vlax-get obj2 'startpoint))
  (setq p4 (vlax-get obj2 'endpoint))
; Calculate the intersection point Line 1 and Line 2.
	(setq apex (inters p1 p2 p3 p4 nil))
; Calculate angle ang.
  (if (equal apex p1 0.01)(setq end1 p2)(setq end1 p1))
  (if (equal apex p3 0.01)(setq end2 p4)(setq end2 p3))
  (angle-between-lines end1 apex end2)

(setq rad (/ (/ (car lst) 2.0) (sin (/ (* propval (- pi ang)) 2.0))))

(setq oldsnap (getvar 'osmode))
(setvar 'osmode 0)

; now do the draw chords.

 

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