Consider what you'd do with ruler and compass. Suppose your two known points are $A$ and $B$, then you'd draw a circle around $A$ with radius $AC$ and a circle around $B$ with radius $BC$. These circles would intersect in two points, either of which would qualify as $C$ unless you know the orientation of the triangle. To replicate this in a program, you have to implement (or find a library to compute) the intersection of two circles.
Since your question is tagged trigonometry, have a look at the cosine law. It allows you to compute (the cosine of) an angle given the three lengths of a triangle. So you can know how far along the line $AB$ you have to go, and using the Pythagorean theorem or some altitude formula you can also compute how far you have to go perpendicular to that line, in order to find $C$.
To be more precise, if $D$ is the point on line $AB$ such that both $\triangle ADC$ and $\triangle BDC$ have a right angle at $D$, then the cosine law gives you
\begin{align*}
\lvert AD\rvert &= \frac{\lvert AB\rvert^2+\lvert AC\rvert^2-\lvert BC\rvert^2}
{2\,\lvert AB\rvert} \\
\lvert BD\rvert &= \frac{\lvert AB\rvert^2+\lvert BC\rvert^2-\lvert AC\rvert^2}
{2\,\lvert AB\rvert} \\
\lvert CD\rvert &= \frac{\sqrt{
\left(\lvert AB\rvert + \lvert AC\rvert + \lvert BC\rvert\right)
\left(\lvert AB\rvert + \lvert AC\rvert - \lvert BC\rvert\right)
\left(\lvert AB\rvert - \lvert AC\rvert + \lvert BC\rvert\right)
\left(-\lvert AB\rvert + \lvert AC\rvert + \lvert BC\rvert\right)
}}{2\,\lvert AB\rvert}
\end{align*}
If you always want the $(x-x_1,y-y_1)$ vector to be rotated $90°$ counter-clockwise against the $(x_2-x_1,y_2-y_1)$ one, then you have
\begin{align*}
n(x-x_1) &= m(y_1-y_2) \\
n(y-y_1) &= m(x_2-x_1)
\end{align*}
So the left $y$ difference is the right $x$ difference, and the left $x$ difference is the negative of the right $y$ difference. This amounts to the $90°$ rotation I mentioned.
Solve the above and you find
\begin{align*}
x &= \frac{m(y_1-y_2)}n+x_1 \\
y &= \frac{m(x_2-x_1)}n+y_1
\end{align*}
which corresponds to one of your four solutions.
Best Answer
Here is a solution that does not necessitate trigonometry:
Let $r = $ distance AC.
The solution is given by
$$\tag{1}\vec{AC}=r\vec{v} \ \ \ \ \ \iff \ \ \ \ \ C=A+r\vec{v},$$
where $\vec{v}$ is a unit (length 1) vector orthogonal to $\vec{AB}$.
Let $n=\sqrt{(x_B-x_A)^2+(y_B-y_A)^2}$ be the norm of $\vec{AB}$.
Expressing (1) with coordinates (using the fact that vector $\binom{-b}{a}$ is directly orthogonal to $\binom{a}{b}$):
$$\binom{x_C}{y_C}=\binom{x_A-\tfrac{r}{n}(y_B-y_A)}{y_A+\tfrac{r}{n}(x_B-x_A)},$$
and, in a symmetrical way:
$$\binom{x_{C'}}{y_{C'}}=\binom{x_A+\tfrac{r}{n}(y_B-y_A)}{y_A-\tfrac{r}{n}(x_B-x_A)}.$$