Find point on rational circle for given angle I've a circle defined by 3 rationals points on the circle.
I need to calculate another rational point on the circle given by an angle (a floating point number). The resulting angle does not need to be exact, but within certain limits (so the rational point should be close to the real point).
It seems the default rational parametrisation of a circle
$x=\frac{2t}{t^2+1}$ and $y=\frac{t^2-1}{t^2+1}$ is not helpful as it requires $t\to\infty$ for points close to the angle $\frac{\pi}{2}$.
How can I reliably find such rationals points on a rational circle?
 A: 
It seems the default rational parametrisation of a circle
  $x=\frac{2t}{t^2+1}$ and $y=\frac{t^2-1}{t^2+1}$ is not helpful as it requires $t\to\infty$ for points close to the angle $\frac{\pi}{2}$.

One elegant way of dealing with this problem is by using a homogeneous approach: introduce a second parameter $u$ like this:
$$ x = \frac{2tu}{t^2+u^2} \qquad y = \frac{t^2-u^2}{t^2+u^2} $$
The old $t$ corresponds to $\frac tu$ in the new parameters. The situation of $t\to\infty$ can now be described by $t=1,u=0$ which represents division by zero in a well-defined way.
Suppose you have a point $(x,y)$ on the unit circle, i.e. with $x^2+y^2=1$. This is what you'd get from having an angle, with $x=\cos\varphi$ and $y=\sin\varphi$. Then you can choose $t=x,u=1-y$. To verify this claim:
$$\frac{2x(1-y)}{x^2+(1-y)^2}
= \frac{2x(1-y)}{(x^2+y^2)+1-2y}
= \frac{2x(1-y)}{2-2y} = x \\
\frac{x^2-(1-y)^2}{x^2+(1-y)^2}
= \frac{x^2-1+2y-y^2}{(x^2+y^2)+1-2y}
= \frac{x^2-(x^2+y^2)+2y-y^2}{2-2y}
= \frac{2y-2y^2}{2-2y} = y$$
As usual for homogeneous coordinates, multiples of the parameter vector $(t,u)$ describe the same point. So if $\frac tu\in\mathbb Q$ (rational) you can even choose $t,u\in\mathbb Z$ (integers). You might compute $t$ and $u$ from an angle $\varphi$ as described above, to obtain a first floating-point approximation. Then you can check which of these is larger, and try to approximate either $\frac tu$ or $\frac ut$ by a rational number, e.g. using continued fraction approximations. The numerator and denominator of the resulting fraction can then be used as parameters $t$ and $u$ for the formula above.
Personally I'd usually use $x=\frac{u^2-t^2}{u^2+t^2}$ and $y=\frac{2tu}{u^2+t^2}$, so that $t=0,u=1$ represents $0°$, $t=1,u=1$ is $90°$, $t=-1,u=1$ is $-90°$ and $t=1,u=0$ is $\pm180°$. That way you have $\frac tu=\tan\frac\varphi2$, which gives rise to the term tangent half-angle substitution. In that case you'd choose $t=y$ and $u=1+x$. It's just a minor change of coordinate system, though.
As noted in the comment, the above description works for the unit circle, and by a simple scaling also works for circles with rational radius. But circles defined by three rational points may well have an irrational radius. To deal with that fact, you could establish a different coordinate system. The center of the circle (which has rational coordinates) would be the origin of the new coordinate system, and the vector from there to one of the defining points could serve as the first basis vector. The second basis vector would be perpendicular to that.
So if the center of the circle is at $(x_0,y_0)$ and the first of the three defining points is at $(x_1,y_1)$ you could use a parametrization like
\begin{align*}
x &= x_0 + \frac{2tu(x_1-x_0)-(t^2-u^2)(y_1-y_0)}{t^2+u^2} \\
y &= y_0 + \frac{2tu(y_1-y_0)+(t^2-u^2)(x_1-x_0)}{t^2+u^2}
\end{align*}
When reading the parameters $t$ and $u$ off the angle $\varphi$, you'd first have to subtract the angle of the vector from center to first defining point, as that is your first coordinate axis in the new coordinate system.
