|
|
|
@ -707,7 +707,7 @@ plotit(wordlist *wl, char *hcopy, char *devname) |
|
|
|
/* Transform for smith plots */ |
|
|
|
if (gtype == GRID_SMITH) { |
|
|
|
double re, im, rex, imx; |
|
|
|
double r, i, x; |
|
|
|
double r; |
|
|
|
struct dvec **prevvp, *n; |
|
|
|
int j; |
|
|
|
|
|
|
|
@ -743,12 +743,16 @@ plotit(wordlist *wl, char *hcopy, char *devname) |
|
|
|
re = re - 1; |
|
|
|
|
|
|
|
/* (re, im) / (rex, imx) */ |
|
|
|
x = 1 - (imx / rex) * (imx / rex); |
|
|
|
r = re / rex + im / rex * imx / rex; |
|
|
|
i = im / rex - re / rex * imx / rex; |
|
|
|
|
|
|
|
realpart(d->v_compdata + j) = r / x; |
|
|
|
imagpart(d->v_compdata + j) = i / x; |
|
|
|
/* x = 1 - (imx / rex) * (imx / rex); |
|
|
|
* r = re / rex + im / rex * imx / rex; |
|
|
|
* i = im / rex - re / rex * imx / rex; |
|
|
|
* |
|
|
|
* |
|
|
|
* realpart(d->v_compdata + j) = r / x; |
|
|
|
* imagpart(d->v_compdata + j) = i / x; |
|
|
|
*/ |
|
|
|
realpart(d->v_compdata + j) = (rex*re+imx*imx) / (rex*rex+imx*imx); |
|
|
|
imagpart(d->v_compdata + j) = (2*imx) / (rex*rex+imx*imx); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
@ -762,7 +766,11 @@ plotit(wordlist *wl, char *hcopy, char *devname) |
|
|
|
ylims[0] = HUGE; |
|
|
|
ylims[1] = - ylims[0]; |
|
|
|
for (d = vecs; d; d = d->v_link2) { |
|
|
|
dd = ft_minmax(d, TRUE); |
|
|
|
/* dd = ft_minmax(d, TRUE); */ |
|
|
|
/* With this we seek the maximum and minimum of imaginary part |
|
|
|
* that will go to Y axis |
|
|
|
*/ |
|
|
|
dd = ft_minmax(d, FALSE); |
|
|
|
if (dd[0] < ylims[0]) |
|
|
|
ylims[0] = dd[0]; |
|
|
|
if (dd[1] > ylims[1]) |
|
|
|
@ -797,7 +805,11 @@ plotit(wordlist *wl, char *hcopy, char *devname) |
|
|
|
xlims[0] = HUGE; |
|
|
|
xlims[1] = - xlims[0]; |
|
|
|
for (d = vecs; d; d = d->v_link2) { |
|
|
|
dd = ft_minmax(d, FALSE); |
|
|
|
/* dd = ft_minmax(d, FALSE); */ |
|
|
|
/* With this we seek the maximum and minimum of imaginary part |
|
|
|
* that will go to Y axis |
|
|
|
*/ |
|
|
|
dd = ft_minmax(d, TRUE); |
|
|
|
|
|
|
|
if (dd[0] < xlims[0]) |
|
|
|
xlims[0] = dd[0]; |
|
|
|
@ -874,8 +886,13 @@ plotit(wordlist *wl, char *hcopy, char *devname) |
|
|
|
fabs(xlims[1]); |
|
|
|
my = (fabs(ylims[0]) > fabs(ylims[1])) ? fabs(ylims[0]) : |
|
|
|
fabs(ylims[1]); |
|
|
|
rad = (mx > my) ? mx : my; |
|
|
|
/* rad = sqrt(mx * mx + my * my); */ |
|
|
|
/* rad = (mx > my) ? mx : my; */ |
|
|
|
/* AM.Roldán |
|
|
|
* Change this reason that this was discussed, as in the case of 1 + i want to plot point |
|
|
|
* is outside the drawing area so I'll stay as the maximum size of the hypotenuse of |
|
|
|
* the complex value |
|
|
|
*/ |
|
|
|
rad = sqrt(mx * mx + my * my); |
|
|
|
xlims[0] = - rad; |
|
|
|
xlims[1] = rad; |
|
|
|
ylims[0] = - rad; |
|
|
|
|