(41) Intersection points between circles

11302020, 05:19 PM
(This post was last modified: 12012020 04:28 PM by rawi.)
Post: #6




RE: Intersection points between circles
Hi Albert,
thank you very much for the interesting discussion. The solution that is used in my program indeed uses as well the Law of Cosine. The difference between your solution and mine is that I use directly the coordinates given. You first transfer it to an easier problem by setting one midpoint to (0;0) and the other to (d;0), but then you have it to transfer back. I am not yet sure which solution is easier. Unfortunately I do not know how to insert a image that is not on a website. So I try to describe it without a picture. Let (x1,y1) be the coordinates of the first midpoint (x2,y2) be the coordinates of the second midpoint r1 be the radius of the first circle r2 be the radius of the second circle First the distance between midpoints is computed (steps 1630): z=((x1x2)^2+(y1y2)^2)^0.5 Then we compute the angle between line between midpoints and paralell to xaxis (steps3138): alpha = arcsin((y2y1)/z) The triangle made by the midpoints and the first intersection have the sides z, r1 and r2. Therefore we can compute the angle between line between midpoints and line from midpoint of first circle to first intersection point by using the Law of Cosine (steps 3954): beta = arccos((z²+r1²r2²)/(2*z*r1)) Now we must take into account, whether x2<x1 or x2>=x1 and analogue with y1 and y2. We set sg1 = 1 if x2>=x1 and sg1 = 1 if x2<x1 and likewise sg2 = 1 fi y2 >= y1 and sg2 = 1 if y2 < y1. This is done by using flag 01 and flag 02. Then we can compute the coordinates of the two intersection points (sx1, sy1) (steps 5573) and (sx2, sy2) (steps 7595): sx1 = x1 + r1*(cos(alpha+beta))*sg1 sy1 = y1 + r1*(sin(alpha+beta))*sg2 sx2 = x1 + r1*(cos(alphabeta))*sg1 sy2 = y1 + r1*(sin(alphabeta))*sg2 This is the solution given. I hope this makes it a little more transparent. Best Raimund 

« Next Oldest  Next Newest »

Messages In This Thread 
(41) Intersection points between circles  rawi  11252020, 03:07 PM
RE: Intersection points between circles  Albert Chan  11252020, 06:16 PM
RE: Intersection points between circles  rawi  11252020, 06:48 PM
RE: Intersection points between circles  Albert Chan  11262020, 12:22 AM
RE: Intersection points between circles  Albert Chan  11302020, 02:19 PM
RE: Intersection points between circles  rawi  11302020 05:19 PM
RE: Intersection points between circles  Albert Chan  11302020, 09:03 PM
RE: Intersection points between circles  Albert Chan  12012020, 12:17 AM
RE: Intersection points between circles  SlideRule  11302020, 08:51 PM
RE: Intersection points between circles  rawi  12012020, 09:25 AM
RE: Intersection points between circles  Albert Chan  12012020, 11:59 AM
RE: Intersection points between circles  rawi  12012020, 02:04 PM
RE: Intersection points between circles  Albert Chan  12102020, 01:34 PM

User(s) browsing this thread: 1 Guest(s)