[Tex/LaTex] How to represent the “Triangle of Power” in LaTeX

math-modesubscriptssuperscriptssymbols

So, I've just seen a video about a method of notation called "Triangle of Power", which simplifies things when it comes down to exponents, logarithms, etc. It was originally introduced in this post on Math.Stackexchange: https://math.stackexchange.com/questions/30046/alternative-notation-for-exponents-logs-and-roots/165225#165225

I wanted to use it in my LaTeX documents, but couldn't figure out a way to actually write it easily; my knowledge of custom commands and positioning of symbols is not enough.

So, what I want to do is this:

And it needs to have some nice way of not providing one of the values (really, see the video if you're interested). Moreover, it should more-or-less fit in line with other notation, so it shouldn't be too big nor sticking out, though it probably will look okay if the values themselves stick out a little.

How can I implement this?

Working from Akiiino's answer I came up with this, which also works in display mode

 \documentclass[a4paper]{article}
\usepackage{amsmath}

\newcommand{\dotriangle}[1]{%
\raisebox{-.7ex}{$\vcenter{#1\kern.2ex\hbox{$\triangle$}\kern.2ex}$}%
}

\newcommand{\tripow}[3]{% Syntax: \tripow{#1}{#2}{#3} gives you #1 ^ {#2} = #3
\mathop{% We want it to an operator
\mathchoice% We want different functionality in text and display mode
{% DISPLAY MODE
\vphantom{\dotriangle\LARGE}% \vphantom off-set: places the bottom entries.
\rule[-1.4ex]{0.1em}{0pt}% Syntax: [<vetical drop #1>]{<left margin>}{<Should be 0>}
_{\scriptstyle #1}% style of #1 entry
{\overset{\scriptstyle #2}% style of #2 entry
{\dotriangle\LARGE}}% Size of the displayed operator - should match the \vphantom off-set.
\rule[-1.4ex]{0em}{0pt}% Syntax: [<vetical drop #3>]{<Should be 0>}{<Should be 0>}
_{\scriptstyle #3}% style of #3 entry
\rule[0ex]{0.1em}{0pt}% Syntax: [<Should be 0>]{<right margin>}{<Should be 0>}
}%
{% TEXT MODE
\vphantom{\dotriangle\normalsize}%
\rule[-1.05ex]{-0.7ex}{0pt}%
_{#1}%
\overset{#2}%
{\dotriangle\normalsize}% size in text mode
\rule[-1.05ex]{0pt}{0pt}%
_{#3}%
\rule[0ex]{-0.2em}{0pt}%
}%
{% SCRIPT MODE
\vphantom{\dotriangle\normalsize}%
\rule[-1.05ex]{-0.8ex}{0pt}%
_{\scriptstyle #1}%
{\overset{\scriptstyle #2}%
{\dotriangle\normalsize}}% size in script mode
\rule[-1.05ex]{0pt}{0pt}%
_{\scriptstyle #3}%
\rule[0ex]{-0.3em}{0pt}%
}%
{}% SCRIPTSCRIPT MODE
}%
}


Compiling this code

\begin{document}
Here we see some fundamental relations:
\begin{align}
\tripow{x}{a+b}{}&=\tripow{x}{a}{}\cdot\tripow{x}{b}{}
\\
\tripow{x}{}{ab}&=\tripow{x}{}{a}+\tripow{x}{}{b}
\\
\tripow{x}{1/y}{}&=\tripow{}{y}{x}
\\
\tripow{x}{\tripow{x}{}{z}}{}&=z
\text{or}& \tripow{x}{\tripow{x}{}{z}}{z}
\\
\tripow{x}{}{\tripow{x}{y}{}}&=y
\text{or}& \tripow{x}{y}{\tripow{x}{y}{}}
\\
\tripow{}{y}{\tripow{x}{y}{}}&=x
\text{or}& \tripow{x}{y}{\tripow{x}{y}{}}
\\
\tripow{\tripow{}{y}{z}}{y}{}&=z
Here is some more in-line text followed by $\tripow{x}{y}{z}$ which is
the same as saying $x^y=z$. The text on the this line does not