Is there an existing theory of Pythagorean triples for numbers of the form $p+q\sqrt r$ rather than integers?

Here are some partial answers:

  • Primitive Phythagorean Triples of Gaussian Integers, by James T. Cross. Mathematics Magazine, Vol. 59, No. 2 (Apr., 1986), pp. 106-110 DOI: 10.2307/2690428.

  • A Ring of Pythagorean Triples over Quadratic Fields, by C. Somboonkulavudi and A. Harnchoowong. Ukrainian Mathematical Journal, June 2014, Volume 66, Issue 1, pp 153–159 DOI: 10.1007/s11253-014-0918-7

The first paper says:

The primitive Pythagorean triples in $\mathbb Z[\sqrt{-1}]$ are parametrised by $(\frac{a^2+b^2}{2},\frac{a^2-b^2}{2i},ab)$, where $a,b \in \mathbb Z(\sqrt{-1})$ are relatively prime, with positive odd real parts.