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