Suppose that $A, B, C, D$ are in the upper half plane such that $A, B$ lie on a semicircle that crosses the $x$-axis at $A$ and $B$.
I am wondering how I can compute the Mobius transformation that sends
$A$ to $i$,
$C$ to $0$, and
$D$ to $i\infty :=\lim_{y\to \infty} iy$?
I was trying to use the cross ratio but wasn't able to find a way to solve it.
Furthermore, I was wondering if and why my result would change if $A$ and $B$ lie on a vertical line together instead.
Obviously $B$ is irrelevant since it's not used in your conditions for the transformation. The fact that the points are all in the upper half-plane is likewise irrelevant. And finally you can just call $\infty$, well, $\infty$, no need to call it $i\infty$.
Anyway, to compute your transformation $T$, consider it in three stages: (i) in order to send $C$ to $0$, put a factor of $z-C$ in the numerator; (ii) in order to send $D$ to $\infty$, put a factor of $z-D$ in the denominator; (iii) so far we have $(z-C)/(z-D)$; we want to be able to plug $A$ into this and get $i$, which means we must normalize, obtaining
$$ T(z)=\frac{z-C}{z-D}\cdot i\frac{A-D}{A-C}. $$