1

In the question Point reflection over a line complex analysis was used. Can anyone tell me if this method is superior to the standard method (find a perpendicular from the point to the line, find a point on the other side that is equidistant). I have heard that using complex analysis can save precision in certain numerical derivative computations. (If someone can point me to the original text book where this method was discussed, that would be helpful too.)

1 Answers1

0

I would be very surprised if using complex numbers has any impact on the numerical precision of computations like this. Complex analysis may be helpful in deriving formulae for reflection (and for rotation, too). But, in the end, you get formulae for the coordinates of the reflected point, and those formulae will be very similar regardless of how they are derived. The key to numerical precision is careful organization of the steps in the computation (avoiding subtractive cancellation, and so on). I don't see any reason why formulae derived from complex analysis would be superior in this respect.

Despite what one of the comments says, I don't see any use of complex analysis in the answers you cited. The formulae were derived by simple vector methods, which seems like the simplest approach, to me. Incidentally, the code in the original question is not very well written, in my opinion.

Reflection isn't an unstable operation (as far as I can see), which might explain why sophisticated methods have not been developed. Just do the obvious vector calculations, being careful to avoid subtractive cancellation. If that's not good enough, use extended precision arithmetic: C++ has a long double data type, C# has decimal, etc.

bubba
  • 43,483
  • 3
  • 61
  • 122
  • I was in particular thinking about http://mathoverflow.net/questions/64302/numerical-differentiation-what-is-the-best-method and https://en.wikipedia.org/wiki/Numerical_differentiation under Complex Variable Methods. (a) if this is not a complex way, is there such a way to compute the reflection? (b) is there any other way to get more precision? I need as much precision as I can get! – Dr. Parasolian Dec 27 '15 at 17:06
  • I don't know of any reflection method that's analogous to the complex variable methods used for numerical differentiation. Numerical differentiation by finite difference methods is unstable, but reflection isn't (as far as I can see), which might explain why exotic methods have not been developed. Just do the obvious vector calculations, being careful to avoid subtractive cancellation. If that's not good enough, use extended precision arithmetic:C++ has a long double data type, C# has decimal, etc. – bubba Dec 28 '15 at 02:44
  • Got it. I think I understand. Thanks. You also were not thrilled with the way the code in the original question was written. Do you have a an example you like or that is better? – Dr. Parasolian Dec 29 '15 at 12:37
  • Regarding the code ... there are several terms that are computed more than once, like $dxdx + dydy$. Also, the code is no good for your high-precision needs because it uses int variables. – bubba Dec 29 '15 at 15:33