#########################################################################
| 36 | |
| 37 | // ######################################################################### |
| 38 | QString misc::complexRect(double real, double imag, int Precision) |
| 39 | { |
| 40 | QString Text; |
| 41 | if(fabs(imag) < 1e-250) Text = QString::number(real,'g',Precision); |
| 42 | else { |
| 43 | Text = QString::number(imag,'g',Precision); |
| 44 | if(Text.at(0) == '-') { |
| 45 | Text.replace(0,1,'j'); |
| 46 | Text = '-'+Text; |
| 47 | } |
| 48 | else Text = "+j"+Text; |
| 49 | Text = QString::number(real,'g',Precision) + Text; |
| 50 | } |
| 51 | return Text; |
| 52 | } |
| 53 | |
| 54 | QString misc::complexDeg(double real, double imag, int Precision) |
| 55 | { |