[Tex/LaTex] Correct way to typeset ‘implies’ symbol

alignalignatamsmathmath-mode

I want to generate the following mathematics:
math image

The code I am using is this (I am using AMS Math):

$$
  \begin{alignedat}{2}
    &&           \sqrt{x^2+y^2} &= r \\
    &\implies&   x^2+y^2        &= r^2
  \end{alignedat}
$$

But I don't think that this is the correct way. Is there a better way?

Also, is the typesetting in the picture wrong? If it is so, then what should be the correct code?

Best Answer

Since it appears the equations should be aligned on the = symbols, I suggest you use an align* environment.

enter image description here

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align*}
    \sqrt{x^2+y^2} &= r \\
    \implies x^2+y^2 &= r^2
\end{align*}
\end{document}

Don't use $$ in a LaTeX document to start and end (unnumbered) display-math mode. For more on this topic, please see the postings Why is \[ ... \] preferable to $$ ... $$? and What are the differences between $$, \[, align, equation and displaymath?