Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Combine the real and imaginary parts of complex numbers into a single fraction
ResourceFunction["ComplexTogether"][z] combine together the real and imaginary parts of a complex number z into one fraction. |
Combine a complex number into a single fraction:
In[1]:= | ![]() |
Out[1]= | ![]() |
Use in a computation:
In[2]:= | ![]() |
Out[2]= | ![]() |
Combine together all complex numbers within an expression:
In[3]:= | ![]() |
Out[3]= | ![]() |
ComplexTogether works only for numeric complex numbers (with Complex head), not for symbolic expressions containing an imaginary unit:
In[4]:= | ![]() |
Out[4]= | ![]() |
ComplexTogether is a formatted expression with its own Head:
In[5]:= | ![]() |
Out[5]= | ![]() |
ComplexTogether unformats itself when used with functions that have the NumericFunction attribute, assuming all other arguments are numeric:
In[6]:= | ![]() |
Out[6]= | ![]() |
In[7]:= | ![]() |
Out[7]= | ![]() |
In[8]:= | ![]() |
Out[8]= | ![]() |
In[9]:= | ![]() |
Out[9]= | ![]() |
Conversely, ComplexTogether stays formatted if it s not a part of a numeric computation:
In[10]:= | ![]() |
Out[10]= | ![]() |
In[11]:= | ![]() |
Out[11]= | ![]() |
ComplexTogether can be used with any computation:
In[12]:= | ![]() |
Out[12]= | ![]() |
In[13]:= | ![]() |
Out[13]= | ![]() |
In[14]:= | ![]() |
Out[14]= | ![]() |
In[15]:= | ![]() |
Out[15]= | ![]() |
This work is licensed under a Creative Commons Attribution 4.0 International License