2008/8/30 Krzysztof Sobolewski <[EMAIL PROTECTED]>: > I guess I'll have to use BigIntegers to calculate distances. I wonder how > much it'll destroy the performace... :) [Or does someone know an > overflow-resistant way to calculate a distance?] You could probably use an approximate iterative method. I'm not entirely sure of a R^2 -> R iterative method though, someone good at numerical analysis here? Would Newton-Raphson with the gradient (instead of the derivative) work? Hmm. There's also the alpha-max + beta-min algorithm to quickly approximate the length of a vector.
However, perhaps it's safer to just start using BigInteger or, you know, floating point numbers. BigInteger doesn't have a sqrt(), so you'll need to convert to float/double or use iterative methods anyway. Unless you just use the squared distance... So many options. :) Iwanowitch _______________________________________________ tp-devel mailing list [email protected] http://www.thousandparsec.net/tp/mailman.php/listinfo/tp-devel
