[Tex/LaTex] Circle symbol compatible with \square and \triangle

math-modesymbols

I need a circle symbol that is somehow compatible (from a layout point of view) with \square and \triangle. As you can see in the following example

\documentclass{article}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amsfonts}
\begin{document}
$\circ AB$, $\bigcirc AB$, $\square ABCD$,  $\triangle ABC$, 
\end{document}

the square and the triangle are a perfect match, but none of the circle symbols match. Is there a way to get a circle aligned with bottom line of the text and with a comparable height as the other two symbols? In maths mode.

image

I've seen this question, but is not the right one for my situation:
Is there a circle symbol?

Best Answer

You can scale \bigcirc down:

\documentclass{article}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amssymb}
\usepackage{graphicx}

\makeatletter
\DeclareRobustCommand{\iscircle}{\mathord{\mathpalette\is@circle\relax}}
\newcommand\is@circle[2]{%
  \begingroup
  \sbox\z@{\raisebox{\depth}{$\m@th#1\bigcirc$}}%
  \sbox\tw@{$#1\square$}%
  \resizebox{!}{\ht\tw@}{\usebox{\z@}}%
  \endgroup
}
\makeatother

\begin{document}

$\iscircle AB$, $\square ABCD$,  $\triangle ABC$,

\end{document}

enter image description here