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 ?