(41) Intersection points between circles
|
12-01-2020, 02:04 PM
(This post was last modified: 12-01-2020 04:29 PM by rawi.)
Post: #12
|
|||
|
|||
RE: Intersection points between circles
Hi Albert,
I tried it and you are totally right. Thanks for pointing that out to me. Here is the improved method description: Let (x1, y1) be the coordinates of midpoint of circle 1 and (x2, y2) be the coordinates of midpoint of circle 2 and r1 resp. r2 be the radii. Let z be the distance between the midpoints: z=((x1-x2)²+(y1-y2)²)^0.5 The angle alpha between the line between the midpoints and the parallel to the x-axis through (x1, y1) using the sinus-function is: alpha = arcsin((y2-y1)/z) Beta can be computed by using the Law of Cosine: beta = arccos((z²+r1²-r2²)/(2*z*r1)) We must take into account, whether x2<x1 or x2>=x1. We set sg = 1 if x2>=x1 and sg1 = -1 if x2<x1 Then the coordinates of the two intersection points are: sx1 = x1 + r1*(cos(alpha+beta))*sg sy1 = y1 + r1*(sin(alpha+beta)) sx2 = x1 + r1*(cos(alpha-beta))*sg sy2 = y1 + r1*(sin(alpha-beta)) And here is the improved code, which is shorter and easier than the previous one: Code: 01 LBL „CIP“ |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
(41) Intersection points between circles - rawi - 11-25-2020, 03:07 PM
RE: Intersection points between circles - Albert Chan - 11-25-2020, 06:16 PM
RE: Intersection points between circles - rawi - 11-25-2020, 06:48 PM
RE: Intersection points between circles - Albert Chan - 11-26-2020, 12:22 AM
RE: Intersection points between circles - Albert Chan - 11-30-2020, 02:19 PM
RE: Intersection points between circles - rawi - 11-30-2020, 05:19 PM
RE: Intersection points between circles - Albert Chan - 11-30-2020, 09:03 PM
RE: Intersection points between circles - Albert Chan - 12-01-2020, 12:17 AM
RE: Intersection points between circles - SlideRule - 11-30-2020, 08:51 PM
RE: Intersection points between circles - rawi - 12-01-2020, 09:25 AM
RE: Intersection points between circles - Albert Chan - 12-01-2020, 11:59 AM
RE: Intersection points between circles - rawi - 12-01-2020 02:04 PM
RE: Intersection points between circles - Albert Chan - 12-10-2020, 01:34 PM
|
User(s) browsing this thread: 2 Guest(s)