PDA

View Full Version : One more question regarding great circle and two intersecting course.


Sims
October 8th 03, 07:44 PM
Hi,

Thanks to all the replies to my earlier post i managed to approximate a
solution to my problem.
But it also raised another question.

If i have 2 'line' given by lat/lon, something like A(lat1, lon1, lat2,
lon2) and B(lat1, lon1, lat2, lon2) how can i calculate the (lat, lon) where
both lines intersect?
(if they do in fact intersect).

Many thanks for your help.

Sims

Dave Patton
October 9th 03, 02:12 AM
"Sims" > wrote in
:

> Hi,
>
> Thanks to all the replies to my earlier post i managed to approximate
> a solution to my problem.
> But it also raised another question.
>
> If i have 2 'line' given by lat/lon, something like A(lat1, lon1,
> lat2, lon2) and B(lat1, lon1, lat2, lon2) how can i calculate the
> (lat, lon) where both lines intersect?
> (if they do in fact intersect).
>
> Many thanks for your help.
>
> Sims

That question has also been asked, and answered, before.
Did you try searching this group's archives, via Google?

--
Dave Patton
Canadian Coordinator, the Degree Confluence Project
http://www.confluence.org dpatton at confluence dot org
My website: http://members.shaw.ca/davepatton/
Vancouver/Whistler - host of the 2010 Winter Olympics

Sims
October 9th 03, 07:08 AM
>
> That question has also been asked, and answered, before.
> Did you try searching this group's archives, via Google?
>

Well that was a somewhat predictable answer fro you.

But again, yes i did look around google and i did not find anything.
I did find some formulas but most of them incomplete or simply did not have
an explanation to go with them.

I searched, "Great circle intersections", "Latitude Longitude intersection",
without great success.

Regards.
Sims

Julian Scarfe
October 9th 03, 07:59 AM
"Sims" > wrote in message
...

> Thanks to all the replies to my earlier post i managed to approximate a
> solution to my problem.
> But it also raised another question.
>
> If i have 2 'line' given by lat/lon, something like A(lat1, lon1, lat2,
> lon2) and B(lat1, lon1, lat2, lon2) how can i calculate the (lat, lon)
where
> both lines intersect?
> (if they do in fact intersect).

What's the application? What problem are you trying to solve with this?

Julian Scarfe

Sims
October 9th 03, 10:53 AM
> > Thanks to all the replies to my earlier post i managed to approximate a
> > solution to my problem.
> > But it also raised another question.
> >
> > If i have 2 'line' given by lat/lon, something like A(lat1, lon1, lat2,
> > lon2) and B(lat1, lon1, lat2, lon2) how can i calculate the (lat, lon)
> where
> > both lines intersect?
> > (if they do in fact intersect).
>
> What's the application? What problem are you trying to solve with this?
>

Hi,

I am trying to draw lat/lon 'lines' on the screen.
But to be efficient i need to cut the lines so that i do not draw them out
of the screen.

Normally, (on a 2D plane), i would have the line i wish to draw and make it
fit into the rectangle created my rectangle.

My the problem with great circle is that the lines are not straight, (well
they are but not on a flat Earth representation).

So i would have a box where the corners themselves would be latitude and
longitudes and using them i could cut my original 'line' to make it fit on a
flat screen.
I hope i did not confuse the matter more by trying to explain it.

Regards,

Sims.

Dave Patton
October 9th 03, 04:17 PM
"Sims" > wrote in
:

>> That question has also been asked, and answered, before.
>> Did you try searching this group's archives, via Google?
>
> Well that was a somewhat predictable answer fro you.
>
> But again, yes i did look around google and i did not find anything.
> I did find some formulas but most of them incomplete or simply did not
> have an explanation to go with them.
>
> I searched, "Great circle intersections", "Latitude Longitude
> intersection", without great success.

OK, here's what I just did, using Google's "Groups" search.
Maybe you were only using Google to search the Web?
(the searches below didn't use the quotes("))

1)
Search for "Great circle intersections" - no obvious results
in the first 3 pages of results listed(normally I'd look through
in more detail, and to at least the 5th results page)
2)
Search for "Latitude Longitude intersection" - hmmm, the first
result listed on the 3rd page of results looks promising:
intersection of two lines
... latitude and longitude (WGS84). How can I compute the
intersection point (x3, y3), also in latitude and longitude?
You can assume that ...
comp.infosystems.gis - 26 Dec 1995 by Tim Tsai
(11 articles)
3)
Viewed the thread, but saw references to out of print books, so...
4)
Try another search, using "intersection of two lines", and got
lots of possible results.
5)
Dave(that's me) suggested the question had been covered before
in this newsgroup, so switch to Advanced Groups Search, and search
sci.geo.satellite-nav for "intersection of two lines".

Of course it finds the same 1995 thread, but the second result
is for a September 10th thread "Software to Find Point Where
Lines Intersect?", and it has some answers that may, or may
not, help you:
<http://groups.google.com/groups?hl=en&lr=&ie=UTF-
8&safe=off&threadm=8dT7b.789%24TN1.187%40newssvr32.news.prodi gy.com&rnum=2&
prev=/groups%3Fq%3Dintersection%2Bof%2Btwo%2Blines%2Bgro up:sci.geo.satellit
e-nav%2Bgroup:sci.geo.satellite-nav%26hl%3Den%26lr%3D%26ie%3DUTF-
8%26group%3Dsci.geo.satellite-nav%26safe%3Doff%26sa%3DG>

--
Dave Patton
Canadian Coordinator, the Degree Confluence Project
http://www.confluence.org dpatton at confluence dot org
My website: http://members.shaw.ca/davepatton/
Vancouver/Whistler - host of the 2010 Winter Olympics

Dale DePriest
October 9th 03, 05:45 PM
Sims wrote:

>>>Thanks to all the replies to my earlier post i managed to approximate a
>>>solution to my problem.
>>>But it also raised another question.
>>>
>>>If i have 2 'line' given by lat/lon, something like A(lat1, lon1, lat2,
>>>lon2) and B(lat1, lon1, lat2, lon2) how can i calculate the (lat, lon)
>>
>>where
>>
>>>both lines intersect?
>>>(if they do in fact intersect).
>>
>>What's the application? What problem are you trying to solve with this?
>>
>
>
> Hi,
>
> I am trying to draw lat/lon 'lines' on the screen.
> But to be efficient i need to cut the lines so that i do not draw them out
> of the screen.
>
> Normally, (on a 2D plane), i would have the line i wish to draw and make it
> fit into the rectangle created my rectangle.
>
> My the problem with great circle is that the lines are not straight, (well
> they are but not on a flat Earth representation).
>
> So i would have a box where the corners themselves would be latitude and
> longitudes and using them i could cut my original 'line' to make it fit on a
> flat screen.
> I hope i did not confuse the matter more by trying to explain it.
>
> Regards,
>
> Sims.
>
>

Typically this sort of problem is solved by using screen coordinates
instead of lat/lon coordinates. Since you have to plot eventually using
screen coordinates you might just use a low level routing to crop the
edges of the screen. You need this anyway for lots of other things.

Dale
--
_ _ Dale DePriest
/`) _ // http://users.cwnet.com/dalede
o/_/ (_(_X_(` For GPS and GPS/PDAs

Julian Scarfe
October 9th 03, 07:25 PM
"Sims" > wrote in message
...

> I am trying to draw lat/lon 'lines' on the screen.
> But to be efficient i need to cut the lines so that i do not draw them out
> of the screen.
>
> Normally, (on a 2D plane), i would have the line i wish to draw and make
it
> fit into the rectangle created my rectangle.
>
> My the problem with great circle is that the lines are not straight, (well
> they are but not on a flat Earth representation).
>
> So i would have a box where the corners themselves would be latitude and
> longitudes and using them i could cut my original 'line' to make it fit on
a
> flat screen.
> I hope i did not confuse the matter more by trying to explain it.

Ok, so the problem is that you want to draw the great circle from (say) 50N
10W to 51N 20W, which is almost east-west. If you were doing a plot with a
cylindrical projection (e.g. mercator) where everything is rectangular, you
could be confident that the line would be contained within the rectangle
((50,10), (51, 20)). But you know very well that the great circle is going
to go some considerable way north of 51N, so you can't use that as the upper
limit of your rectangle.

If that's the problem, the solution is to use Clairaut's formula, which is
of course in Ed's Aviation Formulary, to find the maximum latitude it
reaches:
http://williams.best.vwh.net/avform.htm#Clairaut

Hope that helps

Julian Scarfe

Google