26 #define dtr 0.01745329252
38 PLFLT xvpwxmin, xvpwxmax, xvpwymin, xvpwymax;
41 if ( plsc->level < 2 )
43 plabort(
"plwind: Please set up viewport first" );
51 plwarn(
"plwind: Invalid window limits in x." );
56 plwarn(
"plwind: Invalid window limits in y." );
68 plP_xgvpw( &xvpwxmin, &xvpwxmax, &xvpwymin, &xvpwymax );
72 dx = xvpwxmax - xvpwxmin;
73 dy = xvpwymax - xvpwymin;
75 plsc->wpxscl = ( plsc->vppxma - plsc->vppxmi ) / dx;
76 plsc->wpxoff = ( xmax * plsc->vppxmi - xmin * plsc->vppxma ) / dx;
77 plsc->wpyscl = ( plsc->vppyma - plsc->vppymi ) / dy;
78 plsc->wpyoff = ( ymax * plsc->vppymi - ymin * plsc->vppyma ) / dy;
87 plsc->wmxscl = ( mmxma - mmxmi ) / dx;
88 plsc->wmxoff = ( xmax * mmxmi - xmin * mmxma ) / dx;
89 plsc->wmyscl = ( mmyma - mmymi ) / dy;
90 plsc->wmyoff = ( ymax * mmymi - ymin * mmyma ) / dy;
94 plsc->wdxscl = plsc->wmxscl * plsc->xpmm / ( plsc->phyxma - plsc->phyxmi );
95 plsc->wdxoff = plsc->wmxoff * plsc->xpmm / ( plsc->phyxma - plsc->phyxmi );
96 plsc->wdyscl = plsc->wmyscl * plsc->ypmm / ( plsc->phyyma - plsc->phyymi );
97 plsc->wdyoff = plsc->wmyoff * plsc->ypmm / ( plsc->phyyma - plsc->phyymi );
101 w.
dxmi = plsc->vpdxmi;
102 w.
dxma = plsc->vpdxma;
103 w.
dymi = plsc->vpdymi;
104 w.
dyma = plsc->vpdyma;
144 PLFLT cx, cy, saz, caz, salt, calt, zscale;
146 if ( plsc->level < 3 )
148 plabort(
"plw3d: Please set up 2-d window first" );
151 if ( basex <= 0.0 || basey <= 0.0 || height <= 0.0 )
153 plabort(
"plw3d: Invalid world coordinate boxsize" );
156 if ( xmin0 == xmax0 || ymin0 == ymax0 || zmin0 == zmax0 )
158 plabort(
"plw3d: Invalid axis range" );
161 if ( alt < 0.0 || alt > 90.0 )
163 plabort(
"plw3d: Altitude must be between 0 and 90 degrees" );
167 d = 1.0e-5 * ( xmax0 - xmin0 );
170 d = 1.0e-5 * ( ymax0 - ymin0 );
173 d = 1.0e-5 * ( zmax0 - zmin0 );
176 cx = basex / ( xmax -
xmin );
177 cy = basey / ( ymax -
ymin );
178 zscale = height / ( zmax - zmin );
179 saz = sin(
dtr * az );
180 caz = cos(
dtr * az );
181 salt = sin(
dtr * alt );
182 calt = cos(
dtr * alt );
188 plsc->zzscl = zscale;
192 plsc->base3x = basex;
193 plsc->base3y = basey;
194 plsc->basecx = 0.5 * ( xmin +
xmax );
195 plsc->basecy = 0.5 * ( ymin +
ymax );
234 plsc->cxx = cx * caz;
235 plsc->cxy = -cy * saz;
236 plsc->cyx = cx * saz * salt;
237 plsc->cyy = cy * caz * salt;
238 plsc->cyz = zscale * calt;
239 plsc->czx = -cx * calt * saz;
240 plsc->czy = -cy * calt * caz;
241 plsc->czz = zscale * salt;
void c_plw3d(PLFLT basex, PLFLT basey, PLFLT height, PLFLT xmin0, PLFLT xmax0, PLFLT ymin0, PLFLT ymax0, PLFLT zmin0, PLFLT zmax0, PLFLT alt, PLFLT az)
void plP_swin(PLWindow *plwin)
void plabort(const char *errormsg)
void c_plwind(PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax)
void plwarn(const char *errormsg)
void plP_xgvpw(PLFLT *p_xmin, PLFLT *p_xmax, PLFLT *p_ymin, PLFLT *p_ymax)
dx
if { $zoomopts($this,1) == 0 } then {