siunitx
accepts complex numbers given in rectangular format. In LaTeX, a polar complex number can be written as <number>\angle<angle value>^{<degree symbol>}
, but siunitx
does not accept such format, simply because it contains symbols rather than numbers.
Of course, I can convert a value from polar to rectangular, but in electrical engineering, polar formats may contain important information that we cannot see directly in a rectangular one. Is there a command or custom code that I can use to let siunitx
accept commands in polar format? Ideally, the command should be as follows
\polar[<angle options>]{<magnitude>}{<angle>}
where <angle options>
specify whether the angle is in degrees or radians and the possibility to enter the angle in one unit but convert it to another when typeset.
siunitx
should then process the magnitude just as it process any other number (e.g., by adding an exponent or decimal digits). It should process the angle only by approximating it to certain decimal digits or significant figures, but without converting it to an exponential format.
Here is an example of what I am looking for. However, instead of entering the number manually and adding \si{<unit>}
, I would like to use \SI{<value>}{<unit>}
.
\documentclass{book}
\usepackage{mathtools}
\usepackage{siunitx}
\sisetup{scientific-notation=engineering,exponent-product=\cdot,exponent-to-prefix=true}
\sisetup{add-decimal-zero=true,add-integer-zero=true,round-integer-to-decimal=false,zero-decimal-to-integer=true}
\renewcommand{\deg}{\SIUnitSymbolDegree}
\begin{document}
The output I get $3000\angle-36.9^{\deg} \si{\ampere}$
\vspace{0.5\baselineskip}
The output I want $3\angle-36.9^{\deg} \si{\kilo\ampere}$
\SI{value}{unit commands}
\end{document}