49 if ( ( ( plsc->arrow_x = (
PLFLT *) malloc( (
size_t) npts *
sizeof (
PLFLT ) ) ) == NULL ) ||
50 ( ( plsc->arrow_y = (
PLFLT *) malloc( (
size_t) npts *
sizeof (
PLFLT ) ) ) == NULL ) )
52 plexit(
"c_plsvect: Insufficient memory" );
55 plsc->arrow_npts = npts;
56 plsc->arrow_fill = fill;
57 for ( i = 0; i < npts; i++ )
59 plsc->arrow_x[i] = arrowx[i];
60 plsc->arrow_y[i] = arrowy[i];
70 PLFLT uu, vv, px0, py0, dpx, dpy;
77 if ( uu == 0.0 && vv == 0.0 )
80 if ( ( ( a_x = (
PLINT *) malloc(
sizeof (
PLINT ) * (
size_t) ( plsc->arrow_npts ) ) ) == NULL ) ||
81 ( ( a_y = (
PLINT *) malloc(
sizeof (
PLINT ) * (
size_t) ( plsc->arrow_npts ) ) ) == NULL ) )
83 plexit(
"plP_plotvect: Insufficient memory" );
89 pldebug(
"plP_plotvect",
"%f %f %d %d\n", x, y, px0, py0 );
96 for ( j = 0; j < plsc->arrow_npts; j++ )
98 a_x[j] = (
PLINT) ( plsc->arrow_x[j] * dpx - plsc->arrow_y[j] * dpy + px0 );
99 a_y[j] = (
PLINT) ( plsc->arrow_x[j] * dpy + plsc->arrow_y[j] * dpx + py0 );
104 if ( plsc->arrow_fill )
106 plP_plfclp( a_x, a_y, plsc->arrow_npts, plsc->clpxmi, plsc->clpxma,
107 plsc->clpymi, plsc->clpyma,
plP_fill );
110 free( (
void *) a_x );
111 free( (
void *) a_y );
128 PLFLT lscale,
dx,
dy, dxmin, dymin, umax, vmax;
135 for ( j = 0; j <
ny; j++ )
137 for ( i = 0; i <
nx; i++ )
139 u[i][j] = getuv( i, j, up );
140 v[i][j] = getuv( i, j, vp );
148 if ( nx <= 1 && ny <= 1 )
150 fprintf( stderr,
"plfvect: not enough points for autoscaling\n" );
155 for ( j = 0; j <
ny; j++ )
157 for ( i = 0; i <
nx; i++ )
159 for ( j1 = j; j1 <
ny; j1++ )
161 for ( i1 = 0; i1 <
nx; i1++ )
163 dx = fabs( x[i1][j1] - x[i][j] );
164 dy = fabs( y[i1][j1] - y[i][j] );
167 dxmin = ( dx < dxmin ) ? dx : dxmin;
171 dymin = ( dy < dymin ) ? dy : dymin;
179 for ( j = 0; j <
ny; j++ )
181 for ( i = 0; i <
nx; i++ )
183 umax = ( u[i][j] > umax ) ? u[i][j] : umax;
184 vmax = ( v[i][j] > vmax ) ? v[i][j] : vmax;
189 lscale = ( umax < vmax ) ? umax : vmax;
190 lscale = 1.5 / lscale;
193 scale = -scale * lscale;
201 for ( j = 0; j <
ny; j++ )
203 for ( i = 0; i <
nx; i++ )
205 plP_plotvect( x[i][j], y[i][j], u[i][j], v[i][j], scale );
221 nx, ny, scale,
pltr, pltr_data );