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 );
void plFree2dGrid(PLFLT **f, PLINT nx, PLINT PL_UNUSED(ny))
void PLFLT PLINT PLINT PLFLT PLFLT PLFLT PLFLT PLINT PLINT PLINT PLFLT PLFLT PLINT PLFLT PLINT const PLINT const char *const PLINT nx
void c_plvect(const PLFLT *const *u, const PLFLT *const *v, PLINT nx, PLINT ny, PLFLT scale, void(*pltr)(PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer), PLPointer pltr_data)
void PLFLT PLINT PLINT PLFLT x
void plAlloc2dGrid(PLFLT ***f, PLINT nx, PLINT ny)
static void pltr(PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, void *pltr_data)
void c_plsvect(const PLFLT *arrowx, const PLFLT *arrowy, PLINT npts, PLINT fill)
void PLFLT PLINT PLINT PLFLT PLFLT y
PLFLT plf2eval1(PLINT ix, PLINT iy, PLPointer plf2eval_data)
void plfvect(PLFLT(*getuv)(PLINT, PLINT, PLPointer), PLPointer up, PLPointer vp, PLINT nx, PLINT ny, PLFLT scale, void(*pltr)(PLFLT, PLFLT, PLFLT *, PLFLT *, PLPointer), PLPointer pltr_data)
static void plP_plotvect(PLFLT x, PLFLT y, PLFLT u, PLFLT v, PLFLT scale)
void plP_fill(short *x, short *y, PLINT npts)
void plP_draphy_poly(PLINT *x, PLINT *y, PLINT n)
void plP_plfclp(PLINT *x, PLINT *y, PLINT npts, PLINT xmin, PLINT xmax, PLINT ymin, PLINT ymax, void(*draw)(short *, short *, PLINT))
dx
if { $zoomopts($this,1) == 0 } then {
void plexit(const char *errormsg)