On 22 Feb., 21:46, Tom Sharpless <tksharpl...@gmail.com> wrote: > > I can't recommend any such library; but I can say that you would be > much better off with 3D vector geometry than trying to use the > spherical trigonometry formulas. For example: given the 3D vertices > of a spherical polygon (which are unit vectors) replace each edge by a > 3D plane, represented by its normal vector (which is just the cross > product of 2 vertices). Then the sign of a dot product with the > normal tests which side of the edge a given point is on, and you can > build everything else on that. In other words, you can replace > spherical trig with linear algebra (but not conversely).
I thought about this approach myself but still hoped I could find a library for spherical surfaces, just merely because the surface of the sphere is the very ground we stand on, literally and pano- metaphorically. > The great weakness of trigonometry is that the error, and even > computability, of the functions varies with direction; but linear > algebra works almost independently of direction, and its few > singularities are far easier to detect and avoid. That is why > engineers pretty much stopped using trig (for geometrical work) as > soon as they had mechanical calculators. I agree. It is rather cumbersome and unobvious, and I've found it really hard to get my head around all the maths involved just to be able to half-ways cope with hugin's lon/lat model and the transforms. I sometimes dream of keeping all image data as clouds of vectors in 3D space... > I put together a small C++ library of 3D vector functions that I use > all the time for panosphere calculations, you are welcome to use it > if you want to. Thank you for the offer. Would you be so kind to point me to this library so I can have a look? It might come in handy. On the other hand, are you aware of GGL, which is now Boost.Geometry? http://geometrylibrary.geodan.nl/ It does geometry and we already have Boost dependencies in hugin, so we might as well use it - it's not yet full part of Boost but Boost- approved, and it treats geometry in a dimension-agnostic way - just not on curved surfaces. Coding with it is a bit awkward to debug - like, I reckon, a lot of 'generic' C++ code - I had a case where a single bug in my program triggered about a hundred screens full of error messages - but if it works it seems to work just fine, like vigra. The generic idea is admittedly intriguing. Kay -- You received this message because you are subscribed to the Google Groups "Hugin and other free panoramic software" group. A list of frequently asked questions is available at: http://wiki.panotools.org/Hugin_FAQ To post to this group, send email to hugin-ptx@googlegroups.com To unsubscribe from this group, send email to hugin-ptx+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/hugin-ptx