From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: how to judge if an arc of a great circle crosses a quadrangle and calculate the positions of the intersects of  on a sphere surface
Date: Tue, 16 Mar 2010 03:04:05 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 14
Message-ID: <hnmsf5$llp$>
References: <hnd5rr$4eq$> <hnem4s$b39$> <hneqe7$frf$> <hnim5l$6ga$> <hnin7d$mv0$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1268708645 22201 (16 Mar 2010 03:04:05 GMT)
NNTP-Posting-Date: Tue, 16 Mar 2010 03:04:05 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1411057
Xref: comp.soft-sys.matlab:617129

"Matt J " <mattjacREMOVE@THISieee.spam> wrote in message <hnin7d$mv0$>...
> In that case, what kind of curve would you want to use to connect the quadrangle vertices and the arc AB? With differing altitudes, it's obviously no longer a circular arc at the surface of a fixed-radius sphere. You could, for example, connect them via a straight line, or something else. 
> Also, what is the definition of intersection that you will use? If  we're now connecting points with curves not confined to the surface of a sphere, these curves presumably have to intersect as curves in 3D space. What are the odds of that ever happening?

Oh, it's some confusing. I think I must state my question again. 

At first, I deal with my problem on a spherical earth surface. I wanna find the intersection of an arc with a quandragle (in fact, I split a big quandragle into many small congruent grids and I have to solve many such intersection problems). All the lines involved are small arcs of great circle on the sphere. Then, I wanna calculate the length of each segment seperated by the small quandrangles, which is easily dealed with by using function distance(). However, Walter Roberson inspired me that altitude may be nontrival in the computation of distance for my problem. So, for simplicity, I still solve the intersection on a sphere, and then take the altitudes of all the points into consideration in the case of distance calculation. The altitude can be known by GPS records according to the lat and long. If two points have the same altitude, their distance is still calculated as a great 
circle(thus the straight-line suggestion is invalid). But if one point is higher, their distance should be longer. I ever asked in the 3rd post if this works(whether it can be treated as a right triangle on a plane): d1 = distance([latA,lonA], [latB,lonB]); d2 = sqrt(d1^2+(altA-altB)^2);. 

To conclude, my first problem is still the same, namely, the intersection-point problem on a sphere. And then, I wanna calculate the length of each segment with altitude involved. The maximum distance doesnot exceed 5 degrees.

(BTW, I'm dealing with the inversion of surface wave, actually.)