octave-patch-tracker
[Top][All Lists]

[Octave-patch-tracker] [patch #9974] [octave forge](mapping) gc2sc scxsc

 From: Philip Nienhuis Subject: [Octave-patch-tracker] [patch #9974] [octave forge](mapping) gc2sc scxsc gcxsc Date: Wed, 7 Oct 2020 18:18:22 -0400 (EDT) User-agent: Mozilla/5.0 (Windows NT 6.1; rv:52.0) Gecko/20100101 Firefox/52.0

```Follow-up Comment #9, patch #9974 (project octave):

I had a little time to look into it further. Next week I might do more.
But I think I have nailed the issues.

My ideas (to be validated !) are as follows:

The strategy & math in the S.O. article mentioned in scxsc.m is absolutely
valid, but fragile. I think before it can be safely invoked various cases have
to be catched to make sure the implicit assumptions are valid.

Case 1 is non-intersecting small circles because they're too far apart. Easily
checked, just see if the smallest spherical distance between the circle
centers is greater than the sum of their radii.

Case 2 is coinciding axes. Easily checked by comparing the circle centers or
antipodes to differ less than -say- 2*eps. Once there:
Case 2A is different circle radii ==> no intersections.
Case 2B is equal radii ==> coinciding circles, infinite intersections.

All three lead to the same outcome, but different warnings.

All these cases can be explored by first computing the spherical distance
between the circle centers for all pairs.
In my spherical trig goniometry textbook (from 1940, a classic) I found the
spherical cosine formula that after experimenting seems to be sufficiently
robust and accurate (no haversines etc. needed with 64-bit floats).
Template / example function attached.

After all these cases have been neutralized, I think all tests in your code
can be dropped as there are no more mathematical issues to watch out for, not
even sqrt of small negative values leading to atan2 choking on complex
numbers.

Will you have a go at it or shall I do it next week or the week after?

(file #49935)
_______________________________________________________

File name: sphdist.m                      Size:0 KB
<https://file.savannah.gnu.org/file/sphdist.m?file_id=49935>

_______________________________________________________

Reply to this item at:

<https://savannah.gnu.org/patch/?9974>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/

```

reply via email to