In the special case described earlier the math is even easier. We
want two reference points, P with coordinates (0, 0) and Q, due north
of P (or south if you're an Aussie) at (0, a) at distance a from P.
Then the points at distance r from P and distance s from Q may be
found by solving the two quadratic equations:
x^2 + y^2 = r^2
and
x^2 + (y-a)^2 = s^2
What is nice about this setup is that y has a very simple solution.
Subtract the two equations to get
(y-a)^2 - y^2 = s^2 - r^2
expand
y^2 - 2 a y + a^2 - y^2 = s^2 - r^2
and conclude
y = (a^2 - s^2 + r^2) / 2 a
Then solve for x
x = +- sqrt(r^2 - y^2)
choosing the +/- root depending on whether the point is to the East or
West of line PQ.
If you find yourself attempting to take a square root of a negative
number, the circles do not intersect (more specifically, they have no
real points of intersection).
You will notice that you never make use of r or s. If you just use
the squares of their values the arithmetic is simplified even more.
Jim
------------------- ---------------------- --------------------
| Jim Cobb | 540 Arapeen Dr. #100 | [EMAIL PROTECTED] |
| Parametric | Salt Lake City, UT | (801)-588-4632 |
| Technology Corp. | 84108-1202 | Fax (801)-588-4650 |
------------------- ---------------------- --------------------
Science is trained and organized common sense. -- Alfred, Lord Tennyson
"Jim Morrison" <[EMAIL PROTECTED]> wrote:
> Here is one way to calculate the intersection points of two circles:
>
> Given circle of radius r1 at origin: x^2 + y^2 = r1^2
>
> Circle at (x0,y0) with radius r2: (x-x0)^2 + (y-y0)^2 = r2^2
>
> Intersection points between the circles lie on a line:
>
> y = mx + b
>
> Where: m = -x0/y0
>
> b = - 1/2y0 (r2^2 - r1^2 - y0^2 - x0^2)
>
> x = (-mb +/- SQR(m^2 b^2 - (m^2+1)(b^2-r1^2)) / (m^2 + 1)
>
> If the roots of x are imaginary (i.e. the radical is negative) then
> there is no intersection.
>
> Adjust coordinates of intersecting circle relative to base circle.
>
> I have this function coded in C, QBASIC and assembler if anyone wants it.
>
> Best regards,
>
> Jim
>
> James E. Morrison
> Astrolabe web pages at: http://myhouse.com/mc/planet/astrodir/astrolab.htm