# Aligning sets of equations

I am trying to align both sides of the inequalities in the picture below:

How do I do it with align?

\begin{align*}
&x = 0, \quad 0 < y \leq r,\\
0 < &x    < \dfrac{r}{\sqrt{2}}, \quad 0 < y \leq \sqrt{r^2-x^2},\\
0 < &y \leq \dfrac{r}{\sqrt{2}}, \quad 0 < x \leq \sqrt{r^2-y^2},\\
0 < &x \leq \dfrac{r}{\sqrt{2}}, \quad 0 < y \leq \dfrac{r}{\sqrt{2}},
\end{align*}


Here is an option with align* and alignat*:

\documentclass{article}

\usepackage{amsmath}

\begin{document}

\begin{align*}
x &= 0,                            & 0 &< y \leq r, \\
0 < x &< \dfrac{r}{\sqrt{2}},          & 0 &< y \leq \sqrt{r^2-x^2}, \\
0 < y &\leq \dfrac{r}{\sqrt{2}},       & 0 &< x \leq \sqrt{r^2-y^2}, \\
0 < x &\leq \dfrac{r}{\sqrt{2}},       & 0 &< y \leq \dfrac{r}{\sqrt{2}},
\end{align*}

\begin{alignat*}{2}
x &= 0,                            & 0 &< y \leq r, \\
0 < x &< \dfrac{r}{\sqrt{2}},          & 0 &< y \leq \sqrt{r^2-x^2}, \\
0 < y &\leq \dfrac{r}{\sqrt{2}},       & 0 &< x \leq \sqrt{r^2-y^2}, \\
0 < x &\leq \dfrac{r}{\sqrt{2}}, \quad & 0 &< y \leq \dfrac{r}{\sqrt{2}},
\end{alignat*}

\end{document}


Here are two ways with TABstacks. In the first case, each equation is a fixed baselineskip from the next (here 1.9\baselineskip), and the equation is composed as two distinct stacked columns, with a \quad between the stacks. In the second case, a single \alignShortstack is used, which allows the vertical gap between equations to be set to a fixed value, here 8pt. Note that the gap between aligned equations has been set to 4em.

\documentclass{article}
\usepackage{mathtools,tabstackengine}
\stackMath
\begin{document}

\setstackgap{L}{1.9\baselineskip} \alignCenterstack{ x =& 0, \\ 0 < x <& \dfrac{r}{\sqrt{2}},\\ 0 < y \leq& \dfrac{r}{\sqrt{2}},\\ 0 < x \leq& \dfrac{r}{\sqrt{2}}, } \quad \alignCenterstack{ 0 <& y \leq r,\\ 0 <& y \leq \sqrt{r^2-x^2},\\ 0 <& x \leq \sqrt{r^2-y^2},\\ 0 <& y \leq \dfrac{r}{\sqrt{2}}, }
\bigskip
\setstackgap{S}{8pt} \setstackaligngap{4em} \alignShortstack{ x =& 0, & 0 <& y \leq r,\\ 0 < x <& \dfrac{r}{\sqrt{2}}, & 0 <& y \leq \sqrt{r^2-x^2},\\ 0 < y \leq& \dfrac{r}{\sqrt{2}}, & 0 <& x \leq \sqrt{r^2-y^2},\\ 0 < x \leq& \dfrac{r}{\sqrt{2}}, & 0 <& y \leq \dfrac{r}{\sqrt{2}}, }
\end{document}