I need to calculate the length of a belt (or chain or wire) around 2 circles (wheels, pulleys). The 2 circles will not be the same size. To do this I think I need to find the points on the circles where two lines are tangent to the circles.
One approach is as follows:
Let X1, Y1, and R1 be the center and radius of circle 1.
And X2, Y2, R2 for circle 2. Assume circle 1 is the smaller of the two and they do not intersect.
1. Draw a line(L1) from X2,Y2 thru X1,Y1 and extend it beyond the smaller circle. (This line is NOT the tangent line unless the circles are the same size.)
2. Draw a line(L2) thru X1,Y1 perpendicular to L1.
3. Draw a line(L3) thru X2,Y2 perpendicular to L1.
4. Draw a line(L4) thru the 2 points where the L2 crosses the edge of circle 1 and and L3 crosses edge of circle 2. Extend this line so it crosses L1 at Point P.
5. The distance from P along L1 to X1,Y1 is the same as the distance from P to the tangent on circle 1. Likewise for circle 2 giving the tangent segment.
6. Same as step 5 for the other tangent segment
7. Calculate total length of the belt as 2 * tangentsegment + contact arc on circle 1 + contact arc on circle 2.
My question is: Is this the best approach to this problem?
And, is this algorithm available in some programming language on the net?
Since the point of contact will be on a line perpendicular to the center of the circle, that point will be (x1,y1+r1). And the other circle's point will be (x2,y2+r2).
I haven't got the solution(yet), but I think your approach has a mistake.
Only if the circles are of the same radius, the tangent to both circles runs thru the point on the perpendicular line to your L1.If the circles are of differnet radii, the point will be offset by a little!
Look at the picture
Last edited by opus; Jul 18th, 2007 at 02:53 AM.
You're welcome to rate this post!
If your problem is solved, please use the Mark thread as resolved button Wait, I'm too old to hurry!
Opus is correct - the tangent line is offset on both circles.
The easiest way to tackle this is to transform to a set of coordinates in which one of the tangents lies along the x axis - this is just a rotation. Then, from the attached bmp, you can see that the length of the tangent is simply X1-X2. To work out the lengths of the arcs around the pulleys you need the angle of the intercept. This can be easily worked out because all the angles in blue and green are the same - hence it is simply 2 * atan( (Y2-Y1) / (X1-X2) ). The length of the arc thus has the same ratio to the circumference of the circle as the angle does to 360 degrees. Do this for both circles, and add on twice the length of the tangent. Remember to transform the lengths back again afterwards if you change the scale.
If R1 and R2 are the radius of the two circles such that R1>R2 and D is the distance between the centres of the two circles, then:
For instance:
- If R1 = 10, R2 = 5 and D = 30, L is equal to 107,959
- If R1 = R2 = R = 10 and D = 30, L is equal to 122,832 which is the same as 2(Pi)R+2D = 2 x (Pi) x 10 + 2 x 30 = 122,832
Rui
Last edited by Rassis; Jan 9th, 2006 at 11:32 AM.
...este projecto dos Deuses que os homens teimam em arruinar...
Software languages known: Qbasic - TI-Basic - Liberty Basic - Visual Basic 6
Software API's known: Directx 7 and 8
Internet languages, in the process of learning: HTML - JAVASCRIPT - PHP - CSS - MYSQL - AJAX