(41) Intersection points between circles
12-01-2020, 11:59 AM
Post: #11
 Albert Chan Senior Member Posts: 2,231 Joined: Jul 2018
RE: Intersection points between circles
(12-01-2020 09:25 AM)rawi Wrote:  I forgot to mention that I take the absolute figure for computing alpha. I compute
alpha = abs(arcsin((y2-y1)/z)) (see line 37 of program listing). So I limit it to the interval from 0 to pi/2.
...
If I compute without correction of sy (I delete lines 83, 84, 61, 62 of the program) I get:
For x1=-1, y1=-3, r1 = 4, x2 = 6, y2 = 2, r2 = 5 the same results as before.
But if I change the number of circles, i.e.
x1=6, y1=2, r1=5, x2=-1, y2=-3, r2=4
I get
x1 = 2.8380, y1=5.8380, x2=1,3106, y2=3,7349 which is not correct for the y-coordinates.

Try it again, but remove the ABS applied to alpha.
It is this extra ABS that made the program complicated, requiring sg2 correction to undo.

Quote:Perhaps by limiting alpha from 0 to pi/2 and doing the correction both for sx and sy I get correct results?

Yes, it does. Here is the proof that sg2 correction undo ABS.

If y2-y1 ≥ 0, ABS does nothing to alpha, and we had already shown it work in previous post.

If y2-y1 < 0, we have 2 possibilities:

x2-x1 ≥ 0: calculated alpha should really be -alpha:
cos(-alpha ± beta) = cos(alpha pi ∓ beta) * 1
sin(-alpha ± beta) = sin(alpha pi ∓ beta) * -1

x2-x1 < 0: calculated alpha should really be -(pi - alpha):
cos(-(pi - alpha) ± beta) = cos(pi - (alpha ± beta)) = cos(alpha ± beta) * -1
sin(-(pi - alpha) ± beta) = -sin(pi - (alpha ± beta)) = sin(alpha ± beta) * -1
 « 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: 1 Guest(s)