Author 
Message 
christriddle@googlemail.c science forum beginner
Joined: 10 Jul 2006
Posts: 12

Posted: Mon Jul 17, 2006 2:43 pm Post subject:
Intersection between a small and great circle



Hi,
I am looking for a formulae that gives the lat/long of the intersection
between a small circle and a great one. I've got one for two great
circles but am unable to find one for this.
Could anyone help point me in the right direction (or even better
supply a formula!)..
Thanks alot,
Chris 

Back to top 


Robert B. Israel science forum Guru
Joined: 24 Mar 2005
Posts: 2151

Posted: Mon Jul 17, 2006 6:04 pm Post subject:
Re: Intersection between a small and great circle



In article <1153147409.643864.303500@m79g2000cwm.googlegroups.com>,
<christriddle@googlemail.com> wrote:
Quote:  Hi,
I am looking for a formulae that gives the lat/long of the intersection
between a small circle and a great one. I've got one for two great
circles but am unable to find one for this.
Could anyone help point me in the right direction (or even better
supply a formula!)..

I assume this is on a sphere. How are you specifying the small circle
and the great circle?
Basically what you can do is express the circles as the intersections
of the sphere with planes. Get a parametric expression for the
line of intersection of the planes (in cartesian coordinates x,y,z),
find where that intersects the sphere, and convert to latitude and
longitude.
Robert Israel israel@math.ubc.ca
Department of Mathematics http://www.math.ubc.ca/~israel
University of British Columbia Vancouver, BC, Canada 

Back to top 


matt271829news@yahoo.co. science forum Guru
Joined: 11 Sep 2005
Posts: 846

Posted: Mon Jul 17, 2006 7:16 pm Post subject:
Re: Intersection between a small and great circle



christriddle@googlemail.com wrote:
Quote:  Hi,
I am looking for a formulae that gives the lat/long of the intersection
between a small circle and a great one. I've got one for two great
circles but am unable to find one for this.
Could anyone help point me in the right direction (or even better
supply a formula!)..
Thanks alot,
Chris

By coincidence I recently worked out some parametric equations for an
arbitrary circle on a sphere; see
http://groups.google.com/group/sci.math/browse_frm/thread/9fd44d9d4b7ef37a.
I think "all" you need to do is equate two pairs of coordinates (say y
and z) for your two circles, and solve the simultaneous equations for
one of the parameters. This will then locate the (x,y,z) coordinates of
the point(s) of intersection, and the latitude and longitude follows
easily. 

Back to top 


matt271829news@yahoo.co. science forum Guru
Joined: 11 Sep 2005
Posts: 846

Posted: Mon Jul 17, 2006 7:29 pm Post subject:
Re: Intersection between a small and great circle



matt271829news@yahoo.co.uk wrote:
Quote:  christriddle@googlemail.com wrote:
Hi,
I am looking for a formulae that gives the lat/long of the intersection
between a small circle and a great one. I've got one for two great
circles but am unable to find one for this.
Could anyone help point me in the right direction (or even better
supply a formula!)..
Thanks alot,
Chris
By coincidence I recently worked out some parametric equations for an
arbitrary circle on a sphere; see
http://groups.google.com/group/sci.math/browse_frm/thread/9fd44d9d4b7ef37a.
I think "all" you need to do is equate two pairs of coordinates (say y
and z) for your two circles, and solve the simultaneous equations for
one of the parameters. This will then locate the (x,y,z) coordinates of
the point(s) of intersection, and the latitude and longitude follows
easily.

Oh. I think it was you who posted the original question. I didn't
notice! 

Back to top 


matt271829news@yahoo.co. science forum Guru
Joined: 11 Sep 2005
Posts: 846

Posted: Mon Jul 17, 2006 8:01 pm Post subject:
Re: Intersection between a small and great circle



matt271829news@yahoo.co.uk wrote:
Quote:  christriddle@googlemail.com wrote:
Hi,
I am looking for a formulae that gives the lat/long of the intersection
between a small circle and a great one. I've got one for two great
circles but am unable to find one for this.
Could anyone help point me in the right direction (or even better
supply a formula!)..
Thanks alot,
Chris
By coincidence I recently worked out some parametric equations for an
arbitrary circle on a sphere; see
http://groups.google.com/group/sci.math/browse_frm/thread/9fd44d9d4b7ef37a.
I think "all" you need to do is equate two pairs of coordinates (say y
and z) for your two circles, and solve the simultaneous equations for
one of the parameters. This will then locate the (x,y,z) coordinates of
the point(s) of intersection, and the latitude and longitude follows
easily.

Actually, that looks a pain. I think it might be easier to solve the
following equations for x, y, z
x^2 + y^2 + z^2 = r^2 (1)
(x  x1)^2 + (y  y1)^2 + (z  z1)^2 = a1^2 (2)
(x  x2)^2 + (y  y2)^2 + (z  z2)^2 = a2^2 (3)
where (x1, y1, z1) and (x2, y2, z2) are the coordinates of the centres
of the two circles (which you can easily find from their
latitude/longitude), r is the radius of the sphere, and a1, a2 are the
"radii" of the circles, measured as a *straight line* from the centre
to a point on the circle.
The solutions in (x, y, z) will be the point(s) of intersection.
Subtract (2) from (1) and (3) from (1) to get two linear equations,
then some substitutions and you should end up with just a nice easy
quadratic in x to solve.
I think! ... but doing this very hurriedly right now, so forgive any
schoolboy errors... 

Back to top 


Dann Corbit science forum beginner
Joined: 02 Jun 2006
Posts: 47

Posted: Mon Jul 17, 2006 8:24 pm Post subject:
Re: Intersection between a small and great circle



<matt271829news@yahoo.co.uk> wrote in message
news:1153166495.758981.95080@i42g2000cwa.googlegroups.com...
Quote:  matt271829news@yahoo.co.uk wrote:
christriddle@googlemail.com wrote:
Hi,
I am looking for a formulae that gives the lat/long of the intersection
between a small circle and a great one. I've got one for two great
circles but am unable to find one for this.
Could anyone help point me in the right direction (or even better
supply a formula!)..
Thanks alot,
Chris
By coincidence I recently worked out some parametric equations for an
arbitrary circle on a sphere; see
http://groups.google.com/group/sci.math/browse_frm/thread/9fd44d9d4b7ef37a.
I think "all" you need to do is equate two pairs of coordinates (say y
and z) for your two circles, and solve the simultaneous equations for
one of the parameters. This will then locate the (x,y,z) coordinates of
the point(s) of intersection, and the latitude and longitude follows
easily.
Actually, that looks a pain. I think it might be easier to solve the
following equations for x, y, z
x^2 + y^2 + z^2 = r^2 (1)
(x  x1)^2 + (y  y1)^2 + (z  z1)^2 = a1^2 (2)
(x  x2)^2 + (y  y2)^2 + (z  z2)^2 = a2^2 (3)
where (x1, y1, z1) and (x2, y2, z2) are the coordinates of the centres
of the two circles (which you can easily find from their
latitude/longitude), r is the radius of the sphere, and a1, a2 are the
"radii" of the circles, measured as a *straight line* from the centre
to a point on the circle.
The solutions in (x, y, z) will be the point(s) of intersection.
Subtract (2) from (1) and (3) from (1) to get two linear equations,
then some substitutions and you should end up with just a nice easy
quadratic in x to solve.
I think! ... but doing this very hurriedly right now, so forgive any
schoolboy errors...

The earth is not a sphere, it is an oblate sphereoid. The difference is
significant, eccentricity being about one part in 299.
I guess that this is a standard GIS problem and has already been worked out
in detail. A perusal of the news:comp.infosystems.gis FAQ may prove
fruitful (I have not done it  so just a guess). 

Back to top 


christriddle@googlemail.c science forum beginner
Joined: 10 Jul 2006
Posts: 12

Posted: Tue Jul 18, 2006 8:14 am Post subject:
Re: Intersection between a small and great circle



Ah thanks for your help. You did indeed help me out with those previous
equations. So many thanks yet again!
Chris
matt271829news@yahoo.co.uk wrote:
Quote:  matt271829news@yahoo.co.uk wrote:
christriddle@googlemail.com wrote:
Hi,
I am looking for a formulae that gives the lat/long of the intersection
between a small circle and a great one. I've got one for two great
circles but am unable to find one for this.
Could anyone help point me in the right direction (or even better
supply a formula!)..
Thanks alot,
Chris
By coincidence I recently worked out some parametric equations for an
arbitrary circle on a sphere; see
http://groups.google.com/group/sci.math/browse_frm/thread/9fd44d9d4b7ef37a.
I think "all" you need to do is equate two pairs of coordinates (say y
and z) for your two circles, and solve the simultaneous equations for
one of the parameters. This will then locate the (x,y,z) coordinates of
the point(s) of intersection, and the latitude and longitude follows
easily.
Actually, that looks a pain. I think it might be easier to solve the
following equations for x, y, z
x^2 + y^2 + z^2 = r^2 (1)
(x  x1)^2 + (y  y1)^2 + (z  z1)^2 = a1^2 (2)
(x  x2)^2 + (y  y2)^2 + (z  z2)^2 = a2^2 (3)
where (x1, y1, z1) and (x2, y2, z2) are the coordinates of the centres
of the two circles (which you can easily find from their
latitude/longitude), r is the radius of the sphere, and a1, a2 are the
"radii" of the circles, measured as a *straight line* from the centre
to a point on the circle.
The solutions in (x, y, z) will be the point(s) of intersection.
Subtract (2) from (1) and (3) from (1) to get two linear equations,
then some substitutions and you should end up with just a nice easy
quadratic in x to solve.
I think! ... but doing this very hurriedly right now, so forgive any
schoolboy errors... 


Back to top 


christriddle@googlemail.c science forum beginner
Joined: 10 Jul 2006
Posts: 12

Posted: Tue Jul 18, 2006 8:54 am Post subject:
Re: Intersection between a small and great circle



Quote:  Actually, that looks a pain. I think it might be easier to solve the
following equations for x, y, z
x^2 + y^2 + z^2 = r^2 (1)
(x  x1)^2 + (y  y1)^2 + (z  z1)^2 = a1^2 (2)
(x  x2)^2 + (y  y2)^2 + (z  z2)^2 = a2^2 (3)
where (x1, y1, z1) and (x2, y2, z2) are the coordinates of the centres
of the two circles (which you can easily find from their
latitude/longitude), r is the radius of the sphere, and a1, a2 are the
"radii" of the circles, measured as a *straight line* from the centre
to a point on the circle.
The solutions in (x, y, z) will be the point(s) of intersection.
Subtract (2) from (1) and (3) from (1) to get two linear equations,
then some substitutions and you should end up with just a nice easy
quadratic in x to solve.
I think! ... but doing this very hurriedly right now, so forgive any
schoolboy errors...

Ok, so I subtracted (2) from (1) to get:
2(XX1 + YY1 + ZZ1)  (X1^2 + Y1^2 + Z1^2) +a1^2 r^2 = 0 (4)
and (3) from (1) to get:
2(XX2 + YY2 + ZZ2)  (X2^2 + Y2^2 + Z2^2) +a2^2 r^2 = 0 (5)
Now I'm stuck! Unless I'm being an utter idiot, I can't see any good
substitutions. So much for my Maths degree!
Thanks,
Chris 

Back to top 


matt271829news@yahoo.co. science forum Guru
Joined: 11 Sep 2005
Posts: 846

Posted: Tue Jul 18, 2006 1:14 pm Post subject:
Re: Intersection between a small and great circle



christriddle@googlemail.com wrote:
Quote:  Actually, that looks a pain. I think it might be easier to solve the
following equations for x, y, z
x^2 + y^2 + z^2 = r^2 (1)
(x  x1)^2 + (y  y1)^2 + (z  z1)^2 = a1^2 (2)
(x  x2)^2 + (y  y2)^2 + (z  z2)^2 = a2^2 (3)
where (x1, y1, z1) and (x2, y2, z2) are the coordinates of the centres
of the two circles (which you can easily find from their
latitude/longitude), r is the radius of the sphere, and a1, a2 are the
"radii" of the circles, measured as a *straight line* from the centre
to a point on the circle.
The solutions in (x, y, z) will be the point(s) of intersection.
Subtract (2) from (1) and (3) from (1) to get two linear equations,
then some substitutions and you should end up with just a nice easy
quadratic in x to solve.
I think! ... but doing this very hurriedly right now, so forgive any
schoolboy errors...
Ok, so I subtracted (2) from (1) to get:
2(XX1 + YY1 + ZZ1)  (X1^2 + Y1^2 + Z1^2) +a1^2 r^2 = 0 (4)
and (3) from (1) to get:
2(XX2 + YY2 + ZZ2)  (X2^2 + Y2^2 + Z2^2) +a2^2 r^2 = 0 (5)
Now I'm stuck! Unless I'm being an utter idiot, I can't see any good
substitutions. So much for my Maths degree!

Your maths degree was a long time ago, yes?!
Notice that x1^2 + y1^2 + z1^2 = x2^2 + y2^2 + z2^2 = r^2, which
simplifies (4) and (5).
Multiply (4) through by z2 and (5) through by z1, then subtract to
eliminate z and yield something of the form
y = A*x + B (6)
Multiply (4) through by y2 and (5) though by y1, then subtract to
eliminate y and yield something of the form
z = C*x + D (7)
(but see caveat below).
Substitute (6) and (7) into (1) and you will get a quadratic in x which
is readily solvable, giving two solutions (circles intersect at two
points), one solution  or, if you prefer, two solutions that happen to
be the same (circles are tangent to each other), or no solutions
(circles don't intersect). Then use the equations (6) and (7) to find
the corresponding y and z.
If you grind through the algebra (which I haven't!) then the profusion
of symbols you end up with will likely have some strong patterns and
symmetries that will enable it to be written in an aesthetically
pleasing way, rather than as a horrible mess.
You also need to be alert to the special cases when (6) and (7) blow up
with division by zero. I think the only case when the solution should
fail in this way (rather than fail "legitimately" when the quadratic
has no real roots) is if the two circles are coincident  or probably
it would be acceptable to fail in this way any time that (x1, y1, z1)
and (x2, y2, z2) are coincident or antipodean. But you might find that
(6) and (7) fail under other circumstances too. If you ignore this
possibility when doing the algebra then, with luck, this problem will
"cancel out" in the final expression for x. To achieve a result free of
spurious blowups it might be easier to derive separate quadratics in y
and z (rather than substituting x back into (6) and (7)), and then try
to match up the pairs of solutions. This would also give a nice set of
symmetrical solutions for x, y and z. 

Back to top 


christriddle@googlemail.c science forum beginner
Joined: 10 Jul 2006
Posts: 12

Posted: Tue Jul 18, 2006 1:49 pm Post subject:
Re: Intersection between a small and great circle



Err... yeah, it was a long time ago. Honest. ;o)
Prehaps it's just the emense heat today!
Well thanks for the reply, excellent as always! I'll have a read
through it and see if I can awaken my brain again!
Thanks again,
Chris 

Back to top 


matt271829news@yahoo.co. science forum Guru
Joined: 11 Sep 2005
Posts: 846

Posted: Tue Jul 18, 2006 11:02 pm Post subject:
Re: Intersection between a small and great circle



christriddle@googlemail.com wrote:
Quote:  Err... yeah, it was a long time ago. Honest. ;o)
Prehaps it's just the emense heat today!
Well thanks for the reply, excellent as always! I'll have a read
through it and see if I can awaken my brain again!
Thanks again,
Chris

To satisfy my own curiosity I worked through the algebra and got the
points of intersection as
x = (Dy*Pz  Dz*Py +/ Dx*sqrt(Q)) / (2*D)
y = (Dz*Px  Dx*Pz +/ Dy*sqrt(Q)) / (2*D)
z = (Dx*Py  Dy*Px +/ Dz*sqrt(Q)) / (2*D)
where the +/ signs are taken the same (i.e. all plus or all minus),
and
Dx = y1*z2  y2*z1
Dy = z1*x2  z2*x1
Dz = x1*y2  x2*y1
Px = x1*(2*r^2  a2^2)  x2*(2*r^2  a1^2)
Py = y1*(2*r^2  a2^2)  y2*(2*r^2  a1^2)
Pz = z1*(2*r^2  a2^2)  z2*(2*r^2  a1^2)
D = Dx^2 + Dy^2 + Dz^2
Q = 4*r^2*D  (Py^2 + Pz^2 + Px^2)
and x1, y1, z1, x2, y2, z2, r, a1 and a2 are defined as before.
That was as "symmetrical" as I could get it, but there may be a neater
answer. Note that D = 0 (and the solution fails with division by zero)
if and only if the centres of the circles are coincident or
diametrically opposite, in which case the circles either don't
intersect or, in the special case, are coincident. 

Back to top 


matt271829news@yahoo.co. science forum Guru
Joined: 11 Sep 2005
Posts: 846

Posted: Wed Jul 19, 2006 12:51 am Post subject:
Re: Intersection between a small and great circle



Of course, as has been pointed out, my answer assumes that the earth is
a sphere which isn't exactly correct. 

Back to top 


Google


Back to top 



The time now is Fri Nov 24, 2017 8:07 pm  All times are GMT

