QuadrantNumbers - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

MathematicalFunctions[Evalf]

 return the quadrant of the complex plane where a given complex number is located, or return an Array of random complex numbers in each quadrant

Parameters

 complex_number - any complex number around - (optional) list of complex numbers, default value is [0], so that the returned numbers in each quadrant have absolute value around the numbers indicated in the list quadrants - (optional) list of quadrants, default value is [1, 2, 3, 4], so that the returned numbers are in the specified quadrants listformat - (optional) return a list of lists of numbers instead of an Array (the default). floatingpoint - (optional) true or false; whether to return the Array or list of numbers in floating-point notation, obtained by applying evalf to the exact numbers of the intermediate computations. The default is true

Description

 • The QuadrantNumbers command has two related but different purposes to facilitate numerical experimentation and testing of numerical algorithms. First, if a complex number is passed, it returns a single number identifying the quadrant where the passed number is located. Second purpose: when QuadrantNumbers is called with no arguments, or with any of the optional arguments around = [...], quadrants = [...], it returns an organized Array, with components ${A}_{1}$ ${A}_{2}$, ${A}_{3}$ and ${A}_{4}$, of random complex numbers that are located in each of the four quadrants. This is particularly useful for testing the performance of numerical algorithms in different regions of the complex plane.
 • When the optional argument listformat is passed, the returned numbers will be in a list of four lists instead of an Array, each sublist corresponding to a quadrant.
 • Within the context of this command, the four quadrants of the complex plane are defined as usual, plus some conventions to locate the axes: the quadrants do not include the starting semi-axis and do include the ending semi-axis. So,
 – quadrant 1: $0\le x,0, so the real positive semi-axis is not included, but the imaginary positive semi-axis is
 – quadrant 2: $x<0,0\le y$, so the real negative semi-axis is included, but the imaginary positive semi-axis is not
 – quadrant 3: $x\le 0,y<0$, so the real negative semi-axis is not included, but the imaginary negative semi-axis is
 – quadrant 4: $0 or $x=0,y=0$, so the real positive semi-axis is included, but the imaginary negative semi-axis is not
 • The convention for the real positive semi-axis in the fourth quadrant is related to the situation of mathematical functions related to the hypergeometric function that have the branch cut located on the real positive semi-axis and the value of the function there is obtained arriving to the axis from below (i.e. locating the positive real axis in the fourth quadrant).
 • When no arguments are passed, the Array returned - say it is assigned to $A$ - contains only four complex numbers around the origin, given by ${A}_{1}$ ${A}_{2}$, ${A}_{3}$ and ${A}_{4}$. When a list around = [...] is passed, the same organization of numbers per quadrant in ${A}_{1},{A}_{2}$, ... is returned, and in each ${A}_{j}$ there will be numbers with absolute value in between the origin and the absolute value of the first given number, with absolute value equal to the one of the given number, and with absolute value in between the one of the number and the one of the next number. In addition, at the end of the numbers of each quadrant there will be an additional number with absolute value in between the one of the last number and of that number multiplied by Digits/3. All in all, if the list around contains $n$ numbers, there will be n+1 numbers in each quadrant of the returned Array.
 • When the optional argument quadrants = [...] is passed, the Array of numbers returned is still organized with the structure ${A}_{1}$ ${A}_{2}$, ${A}_{3}$ and ${A}_{4}$, but only the ${A}_{j}$ where $j$ is one of the quadrants specified will contain numbers and the other ones will be empty lists or arrays.
 • When the optional argument floatingpoint = false is passed, the returned Array of numbers will contain exact complex numbers of the form $\mathrm{\rho }{ⅇ}^{I\mathrm{\alpha }}$ instead of the same numbers after applying evalf to them.

Examples

 Initialization: Load the package and set the display of special functions in output to typeset mathematical notation (textbook notation):
 > $\mathrm{with}\left(\mathrm{MathematicalFunctions}:-\mathrm{Evalf}\right);\mathrm{Typesetting}:-\mathrm{EnableTypesetRule}\left(\mathrm{Typesetting}:-\mathrm{SpecialFunctionRules}\right):$
 $\left\{{\mathrm{Add}}{,}{\mathrm{Evalb}}{,}{\mathrm{Zoom}}{,}{\mathrm{QuadrantNumbers}}{,}{\mathrm{Singularities}}{,}{\mathrm{GenerateRecurrence}}{,}{\mathrm{PairwiseSummation}}\right\}$ (1)

Consider a list of complex number

 > $L≔\left[1.104686701+0.9380134212I,1.164644325-0.9889247393I,-0.8023493481+3.596784532I,-1.451484463-6.506737839I\right]$
 ${L}{≔}\left[{1.104686701}{+}{0.9380134212}{}{I}{,}{1.164644325}{-}{0.9889247393}{}{I}{,}{-0.8023493481}{+}{3.596784532}{}{I}{,}{-1.451484463}{-}{6.506737839}{}{I}\right]$ (2)

When doing numerical experimentation, interactively or within a program, it is frequently useful to see in which quadrants are the numbers located; for this purpose you can use QuadrantNumbers

 > $\mathrm{map}\left(\mathrm{QuadrantNumbers},L\right)$
 $\left[{1}{,}{4}{,}{2}{,}{3}\right]$ (3)

By convention, each quadrant contains the ending semi-axis, not the starting one

 > $\mathrm{map}\left(\mathrm{QuadrantNumbers},\left[0,1,I,-1,-I\right]\right)$
 $\left[{4}{,}{4}{,}{1}{,}{2}{,}{3}\right]$ (4)

To get an Array of four complex numbers around the origin, you can call QuadrantNumbers with no arguments

 > $\mathrm{QuadrantNumbers}\left(\right)$
 $\left[\begin{array}{c}{0.05953530934}{+}{0.7891952948}{}{I}\\ {-0.4512890613}{+}{0.6501629407}{}{I}\\ {-0.7894746337}{-}{0.05570878890}{}{I}\\ {0.5603893987}{-}{0.5588715310}{}{I}\end{array}\right]$ (5)

The four numbers in this array are located in the four quadrants respectively.

 > $\mathrm{map}\left(\mathrm{QuadrantNumbers},\right)$
 $\left[\begin{array}{c}{1}\\ {2}\\ {3}\\ {4}\end{array}\right]$ (6)

Note that each time you call this command it will return different numbers;  they are chosen randomly.

 > $\mathrm{QuadrantNumbers}\left(\right)$
 $\left[\begin{array}{c}{0.5179927666}{+}{0.6803576553}{}{I}\\ {-0.8228434075}{+}{0.2326623568}{}{I}\\ {-0.1426185909}{-}{0.8431269079}{}{I}\\ {0.8012314934}{-}{0.2987158170}{}{I}\end{array}\right]$ (7)

To get an Array of complex numbers with absolute value around the number 1 (where various special functions happen to be singular) use

 > $\mathrm{QuadrantNumbers}\left(\mathrm{around}=\left[1\right]\right)$
 $\left[\begin{array}{ccc}{0.2283867284}{+}{0.1782335157}{}{I}& {0.8084325983}{+}{0.5885887648}{}{I}& {0.7210705780}{+}{5.037504451}{}{I}\\ {-0.1604555877}{+}{0.2412088062}{}{I}& {-0.8604933959}{+}{0.5094615938}{}{I}& {-1.047232448}{+}{4.979929525}{}{I}\\ {-0.1722919981}{-}{0.2329015913}{}{I}& {-0.09073663578}{-}{0.9958749233}{}{I}& {-1.685305297}{-}{4.801680949}{}{I}\\ {0.2270281045}{-}{0.1799608946}{}{I}& {0.9967320509}{-}{0.08077882542}{}{I}& {3.293807212}{-}{3.879075653}{}{I}\end{array}\right]$ (8)

Consider the singularities of the linear differential equation behind the following AppellF4 function as a function of $z$

 >
 ${\mathrm{F4}}{≔}{{F}}_{{4}}{}\left({1}{,}{2}{,}{3}{,}{4}{,}{5}{,}{z}\right)$ (9)
 > $S≔\mathrm{Singularities}\left(\mathrm{F4}\right)$
 ${S}{≔}\left[{0}{,}{6}{-}{2}{}\sqrt{{5}}{,}\frac{{20}}{{3}}{,}{6}{+}{2}{}\sqrt{{5}}{,}{\mathrm{\infty }}{+}{\mathrm{\infty }}{}{I}\right]$ (10)

Get an Array of exact (not floating-point) complex number around these singularities

 > $A≔\mathrm{QuadrantNumbers}\left(\mathrm{around}=S,\mathrm{floatingpoint}=\mathrm{false}\right)$
 ${A}{≔}\left[\begin{array}{ccccccc}\left(\frac{{235818355005}}{{249999999997}}{-}\frac{{78606118335}{}\sqrt{{5}}}{{249999999997}}\right){}{{ⅇ}}^{\frac{{85464007853}{}{I}}{{499999999994}}{}{\mathrm{\pi }}}& \left({6}{-}{2}{}\sqrt{{5}}\right){}{{ⅇ}}^{\frac{{9949508401}{}{I}}{{999999999988}}{}{\mathrm{\pi }}}& \left(\frac{{4506402031123}}{{749999999991}}{-}\frac{{493597968817}{}\sqrt{{5}}}{{249999999997}}\right){}{{ⅇ}}^{\frac{{363627416873}{}{I}}{{999999999988}}{}{\mathrm{\pi }}}& \frac{{20}{}{{ⅇ}}^{\frac{{109656846529}{}{I}}{{249999999997}}{}{\mathrm{\pi }}}}{{3}}& \left(\frac{{4549855081811}}{{749999999991}}{+}\frac{{450144918129}{}\sqrt{{5}}}{{249999999997}}\right){}{{ⅇ}}^{\frac{{170269515793}{}{I}}{{999999999988}}{}{\mathrm{\pi }}}& \left({6}{+}{2}{}\sqrt{{5}}\right){}{{ⅇ}}^{\frac{{74577847373}{}{I}}{{249999999997}}{}{\mathrm{\pi }}}& \left(\frac{{3854209493301}}{{249999999997}}{+}\frac{{1284736497767}{}\sqrt{{5}}}{{249999999997}}\right){}{{ⅇ}}^{\frac{{31538302949}{}{I}}{{90909090908}}{}{\mathrm{\pi }}}\\ \left(\frac{{235818355005}}{{249999999997}}{-}\frac{{78606118335}{}\sqrt{{5}}}{{249999999997}}\right){}{{ⅇ}}^{\frac{{709905483453}{}{I}}{{999999999988}}{}{\mathrm{\pi }}}& \left({6}{-}{2}{}\sqrt{{5}}\right){}{{ⅇ}}^{\frac{{84557924477}{}{I}}{{90909090908}}{}{\mathrm{\pi }}}& \left(\frac{{4506402031123}}{{749999999991}}{-}\frac{{493597968817}{}\sqrt{{5}}}{{249999999997}}\right){}{{ⅇ}}^{\frac{{685586434823}{}{I}}{{999999999988}}{}{\mathrm{\pi }}}& \frac{{20}{}{{ⅇ}}^{\frac{{144382346049}{}{I}}{{249999999997}}{}{\mathrm{\pi }}}}{{3}}& \left(\frac{{4549855081811}}{{749999999991}}{+}\frac{{450144918129}{}\sqrt{{5}}}{{249999999997}}\right){}{{ⅇ}}^{\frac{{644198178291}{}{I}}{{999999999988}}{}{\mathrm{\pi }}}& \left({6}{+}{2}{}\sqrt{{5}}\right){}{{ⅇ}}^{\frac{{864542897283}{}{I}}{{999999999988}}{}{\mathrm{\pi }}}& \left(\frac{{3854209493301}}{{249999999997}}{+}\frac{{1284736497767}{}\sqrt{{5}}}{{249999999997}}\right){}{{ⅇ}}^{\frac{{475073843039}{}{I}}{{499999999994}}{}{\mathrm{\pi }}}\\ \left(\frac{{235818355005}}{{249999999997}}{-}\frac{{78606118335}{}\sqrt{{5}}}{{249999999997}}\right){}{{ⅇ}}^{{-}\frac{{341098947853}{}{I}}{{499999999994}}{}{\mathrm{\pi }}}& \left({6}{-}{2}{}\sqrt{{5}}\right){}{{ⅇ}}^{{-}\frac{{682937339737}{}{I}}{{999999999988}}{}{\mathrm{\pi }}}& \left(\frac{{4506402031123}}{{749999999991}}{-}\frac{{493597968817}{}\sqrt{{5}}}{{249999999997}}\right){}{{ⅇ}}^{{-}\frac{{234928485965}{}{I}}{{249999999997}}{}{\mathrm{\pi }}}& \frac{{20}{}{{ⅇ}}^{{-}\frac{{481942387325}{}{I}}{{499999999994}}{}{\mathrm{\pi }}}}{{3}}& \left(\frac{{4549855081811}}{{749999999991}}{+}\frac{{450144918129}{}\sqrt{{5}}}{{249999999997}}\right){}{{ⅇ}}^{{-}\frac{{647736343415}{}{I}}{{999999999988}}{}{\mathrm{\pi }}}& \left({6}{+}{2}{}\sqrt{{5}}\right){}{{ⅇ}}^{{-}\frac{{182546200740}{}{I}}{{249999999997}}{}{\mathrm{\pi }}}& \left(\frac{{3854209493301}}{{249999999997}}{+}\frac{{1284736497767}{}\sqrt{{5}}}{{249999999997}}\right){}{{ⅇ}}^{{-}\frac{{15911858460}{}{I}}{{22727272727}}{}{\mathrm{\pi }}}\\ \left(\frac{{235818355005}}{{249999999997}}{-}\frac{{78606118335}{}\sqrt{{5}}}{{249999999997}}\right){}{{ⅇ}}^{{-}\frac{{41425258201}{}{I}}{{499999999994}}{}{\mathrm{\pi }}}& \left({6}{-}{2}{}\sqrt{{5}}\right){}{{ⅇ}}^{{-}\frac{{2798479627}{}{I}}{{999999999988}}{}{\mathrm{\pi }}}& \left(\frac{{4506402031123}}{{749999999991}}{-}\frac{{493597968817}{}\sqrt{{5}}}{{249999999997}}\right){}{{ⅇ}}^{{-}\frac{{450788311293}{}{I}}{{999999999988}}{}{\mathrm{\pi }}}& \frac{{20}{}{{ⅇ}}^{{-}\frac{{21319687011}{}{I}}{{499999999994}}{}{\mathrm{\pi }}}}{{3}}& \left(\frac{{4549855081811}}{{749999999991}}{+}\frac{{450144918129}{}\sqrt{{5}}}{{249999999997}}\right){}{{ⅇ}}^{{-}\frac{{86409639356}{}{I}}{{249999999997}}{}{\mathrm{\pi }}}& \left({6}{+}{2}{}\sqrt{{5}}\right){}{{ⅇ}}^{{-}\frac{{82680971566}{}{I}}{{249999999997}}{}{\mathrm{\pi }}}& \left(\frac{{3854209493301}}{{249999999997}}{+}\frac{{1284736497767}{}\sqrt{{5}}}{{249999999997}}\right){}{{ⅇ}}^{{-}\frac{{64407666101}{}{I}}{{499999999994}}{}{\mathrm{\pi }}}\end{array}\right]$ (11)

Verify that the numbers in each of the ${A}_{j}$ arrays are located in the corresponding quadrant:

 >
 $\left[\begin{array}{ccccccc}{1}& {1}& {1}& {1}& {1}& {1}& {1}\end{array}\right]$ (12)
 >
 $\left[\begin{array}{ccccccc}{2}& {2}& {2}& {2}& {2}& {2}& {2}\end{array}\right]$ (13)
 >
 $\left[\begin{array}{ccccccc}{3}& {3}& {3}& {3}& {3}& {3}& {3}\end{array}\right]$ (14)
 >
 $\left[\begin{array}{ccccccc}{4}& {4}& {4}& {4}& {4}& {4}& {4}\end{array}\right]$ (15)

Note that the absolute values of the numbers in each quadrant are equal or in between the absolute values of the singularities of F4 passed using around. For example, for the numbers in the first quadrant

 >
 $\left[\begin{array}{ccccccc}{0.2401989241}& {1.527864046}& {1.593661596}& {6.666666667}& {10.09269199}& {10.47213595}& {26.90787054}\end{array}\right]$ (16)

These numbers are equal or in between the absolute values of the singularities of F4

 > $\mathrm{evalf}\left(\mathrm{map}\left(\mathrm{abs},S\right)\right)$
 $\left[{0.}{,}{1.527864046}{,}{6.666666667}{,}{10.47213595}{,}{Float}{}\left({\mathrm{\infty }}\right)\right]$ (17)

Compatibility

 • The MathematicalFunctions[Evalf][QuadrantNumbers] command was introduced in Maple 2017.
 • For more information on Maple 2017 changes, see Updates in Maple 2017.