From: <Pet...@es...> - 2001-10-30 09:38:22
|
> The current implementation of angle in vnl_vector.txx is > acos( abs( cos_angle(a,b) ) ) > > Why is the abs there? Thinking about it again, I believe this is a "remainder" of an angle implementation for lines, not vectors. For lines, it makes sense to "forget" about orientation, but for vectors it doesn't. So this "abs" should probably be removed. Peter. |
From: <Pet...@es...> - 2001-11-09 12:16:57
|
> how is the angle between two complex vectors defined? > Is it acos( |a.b| / |a||b| ) ? No, it is just acos( a.b / |a||b| ), which is in general a complex number. This does not really make sense, i.e., there is no natural interpretation of this kind of angles, but it is the only sensible extension of "real" angles. acos( |a.b| / |a||b| ) cannot be correct since then the angle between (1,0) and (-1,1) would be 45 degrees instead of 135 degrees. Peter. |
From: Amitha P. <pe...@cs...> - 2001-11-09 15:52:19
|
> No, it is just acos( a.b / |a||b| ), which is in general a complex > number. How is acos( complex ) defined? Such a function does not exist in vcl, so the template instantiations for vnl_vector<complex> fail. > acos( |a.b| / |a||b| ) cannot be correct since then the angle between > (1,0) and (-1,1) would be 45 degrees instead of 135 degrees. Certainly, for real-valued vectors. However, for complex-valued vectors, perhaps it is "good enough"? Either way, it doesn't really solve the problem of implementation. Amitha. |
From: Peter V. <Pet...@es...> - 2001-11-09 17:44:49
|
> > No, it is just acos( a.b / |a||b| ), which is in general a complex > > number. > > How is acos( complex ) defined? Such a function does not exist in vcl, > so the template instantiations for vnl_vector<complex> fail. Since cos(complex) is well defined ( cos(a+ib) = cos(a)*cosh(b) - i sin(a)*sinh(b) if I did not make a mistake) also acos(complex) is well defined, e.g. by using the (Taylor) series expansion. I don't have an implementation at hand. And it's indeed a rather unusual function. We could of course decide to ensure it is defined in vcl, but that would probably not really be ANSI conformant. > > acos( |a.b| / |a||b| ) cannot be correct since then the angle between > > (1,0) and (-1,1) would be 45 degrees instead of 135 degrees. > > Certainly, for real-valued vectors. However, for complex-valued > vectors, perhaps it is "good enough"? No: it should be defined consistently for real and complex arguments. Doing it like this would not be consistent. Peter. |