Description:
Sort complex numbers in the form of complex conjugate pairs.
Syntax:
A.compair()
Note:
The external library function (See External Library Guide) sorts the specified sequence of complex numbers while putting together complex numbers that are complex conjugates to each other.
The function sorts pairs of complex conjugates by their real parts in ascending order – for each pair, the element having a negative imaginary part goes ahead, and returns pure real number values after all pairs of complex conjugates. If two pairs of complex conjugates have same real part, sort them by absolute numbers in the imaginary parts in descending order and according to the rule that the negative imaginary number goes ahead. As in the first case, put real numbers in ascending order after all pairs of complex conjugates.
Note: Complex numbers should be input in the form of complex conjugate pairs.
Parameter:
A |
A sequence of complex numbers |
Return value:
A sequence
Example:
|
A |
|
1 |
=[[1,1],[3,-2],[5,9],[5,-9],[3,2],[1,-1],[0,-7],[2,0],[5,0],[2,0],[0,7],[5,0],[0,6],[0,-6],[0,-4],[0,4],[-9,7],[-2,7],[-2,-7],[-9,-7]] |
|
2 |
=A1.compair() |
|