Post Reply 
(41) Intersection points between circles
12-10-2020, 01:34 PM
Post: #13
RE: Intersection points between circles
(12-01-2020 02:04 PM)rawi Wrote:  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))

To reduce errors, it may be better if we pick circle1 with the smaller radius, r1 ≤ r2.

With circle1 having smaller radius, beta could be huge. (up to pi)
We could use complement of beta instead:

gamma = arcsin((z²+r1²-r2²)/(2*z*r1)) = pi/2 - beta

With gamma, the coordinates are:

sx1 = x1 + r1 * sin(gamma-alpha) * sg
sy1 = y1 + r1 * cos(gamma-alpha)
sx2 = x1 + r1 * sin(gamma+alpha) * sg
sy2 = y1 r1 * cos(gamma+alpha)

Prove:

If x ≥ 0, sg = 1
cos(alpha ± beta) = cos(beta ± alpha) = sin(gamma ∓ alpha) * 1
sin(alpha ± beta) = ±sin(beta ± alpha) = ±cos(gamma ∓ alpha)

If x <0, sg = -1, alpha should really be pi - alpha
cos(pi-alpha ∓ beta) = cos(alpha ± beta) * -1
sin(pi-alpha ∓ beta) = sin(alpha ± beta)
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Intersection points between circles - Albert Chan - 12-10-2020 01:34 PM



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