On Tue, Jul 23, 2013 at 3:13 PM, Henry Baker <hbaker1@pipeline.com> wrote:
Various forms of 'rationalize' in Maxima & Common Lisp attempt to produce a rational number that approximates a given number but the magnitude of the rational's denominator is limited.
This problem can be easily solved with a continued fraction approximation.
The question now is how to 'rationalize' a _vector_ of given numbers, but do so with a single denominator.
In other words, I'd like to approximate the vector [x,y,z] with a rational vector [xn/d,yn/d,zn/d], where xn, yn, zn, d are all integers, but this rational vector is the _best possible_ with the given denominator bound.
The problem with rationalizing x, y, z individually is that the denominators might be so different that the overall denominator gets too big.
Also, we'd like to measure 'close' using the traditional Euclidean norm sqrt((x-xn/d)^2,(y-yn/d)^2,(z-zn/d)^2).
I would guess that the answer for 2D is Gaussian continued fractions, and that the answer for dimensions 3 & 4 has something to do with quaternion continued fractions ?
Actually, it has to do with "cubic" continued fractions. See, e.g. Gupta & Mittal, "Bifurcating Continued Fractions" and Mittal & Gupta "Bifurcating Continued Fractions II". Both are available on the arxiv or here: http://www.cs.auckland.ac.nz/~mike/maths/continued%20fractions/BCF1.pdf http://www.cs.auckland.ac.nz/~mike/maths/continued%20fractions/BCF2.pdf -- Mike Stay - metaweta@gmail.com http://www.cs.auckland.ac.nz/~mike http://reperiendi.wordpress.com