obtain fibonacci box from a pythagorean triple?

79 Views Asked by At

Given a pythagorean triple $(a, b, c)$, how can you get back the corresponding Fibonnaci box? Note the triple is not necessarily a primitive one, but if this simplifies the solution that is helpful too.

The inverse is well known. Given a Fibonnaci box:

$$ \begin{bmatrix} q & q'\\ p & p'\\ \end{bmatrix} $$

where $p = q' + q, p' = q + p$, then

$$ a = 2 q p\\ b = p' q'\\ c = p p' - q q' = q p' + q' p = q^2 + p^2 = p'^2 - 2 q p = q'^2 + 2 q p $$

The question is: how to get $q$, $q'$, $p$, $p'$ from $(a, b, c)$?

1

There are 1 best solutions below

1
On BEST ANSWER

You are really looking for $q$ and $q'$ such that $$a=2pq=2q(q'+q)=2qq'+2q^2$$ and $$b=p'q'=(q+p)q'=(2q+q')q'=2qq'+q'^2.$$ We can also write $b=u^2-v^2$ with $u=(q+q')$ and $v=q$, and then $a=2uv$ and $c=u^2+v^2$. From this, we readily recover $u^2=\frac{b+c}2$ and then $q=v=\frac a{2u}$. Ultimately, $q'=u-q$. Written explicitly (where $a$ is the more even leg of the triangle): $$q=\frac{a}{\sqrt{2(b+c)}},\qquad q'=\frac{b+c-a}{\sqrt{2(b+c)}}. $$