From: <ai...@us...> - 2014-01-29 01:43:05
|
Revision: 12968 http://sourceforge.net/p/plplot/code/12968 Author: airwin Date: 2014-01-29 01:42:57 +0000 (Wed, 29 Jan 2014) Log Message: ----------- Use better parameter names (xmin0, xmax0, ymin0, ymax0, zmin0, zmax0) ==> (xmin, xmax, ymin, ymax, zmin, zmax) for some of the plw3d arguments. Modified Paths: -------------- trunk/include/plplot.h trunk/src/plwind.c Modified: trunk/include/plplot.h =================================================================== --- trunk/include/plplot.h 2014-01-29 00:29:24 UTC (rev 12967) +++ trunk/include/plplot.h 2014-01-29 01:42:57 UTC (rev 12968) @@ -1980,9 +1980,9 @@ // Set up a window for three-dimensional plotting. PLDLLIMPEXP 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 ); +c_plw3d( PLFLT basex, PLFLT basey, PLFLT height, PLFLT xmin, + PLFLT xmax, PLFLT ymin, PLFLT ymax, PLFLT zmin, + PLFLT zmax, PLFLT alt, PLFLT az ); #ifdef PL_DEPRECATED // Set pen width with deprecated integer width Modified: trunk/src/plwind.c =================================================================== --- trunk/src/plwind.c 2014-01-29 00:29:24 UTC (rev 12967) +++ trunk/src/plwind.c 2014-01-29 01:42:57 UTC (rev 12968) @@ -136,11 +136,11 @@ //-------------------------------------------------------------------------- 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 ) +c_plw3d( PLFLT basex, PLFLT basey, PLFLT height, PLFLT xmin, + PLFLT xmax, PLFLT ymin, PLFLT ymax, PLFLT zmin, + PLFLT zmax, PLFLT alt, PLFLT az ) { - PLFLT xmin, xmax, ymin, ymax, zmin, zmax, d; + PLFLT xmin_adjusted, xmax_adjusted, ymin_adjusted, ymax_adjusted, zmin_adjusted, zmax_adjusted, d; PLFLT cx, cy, saz, caz, salt, calt, zscale; if ( plsc->level < 3 ) @@ -153,7 +153,7 @@ plabort( "plw3d: Invalid world coordinate boxsize" ); return; } - if ( xmin0 == xmax0 || ymin0 == ymax0 || zmin0 == zmax0 ) + if ( xmin == xmax || ymin == ymax || zmin == zmax ) { plabort( "plw3d: Invalid axis range" ); return; @@ -164,40 +164,40 @@ return; } - d = 1.0e-5 * ( xmax0 - xmin0 ); - xmax = xmax0 + d; - xmin = xmin0 - d; - d = 1.0e-5 * ( ymax0 - ymin0 ); - ymax = ymax0 + d; - ymin = ymin0 - d; - d = 1.0e-5 * ( zmax0 - zmin0 ); - zmax = zmax0 + d; - zmin = zmin0 - d; - cx = basex / ( xmax - xmin ); - cy = basey / ( ymax - ymin ); - zscale = height / ( zmax - zmin ); - saz = sin( dtr * az ); - caz = cos( dtr * az ); - salt = sin( dtr * alt ); - calt = cos( dtr * alt ); + d = 1.0e-5 * ( xmax - xmin ); + xmax_adjusted = xmax + d; + xmin_adjusted = xmin - d; + d = 1.0e-5 * ( ymax - ymin ); + ymax_adjusted = ymax + d; + ymin_adjusted = ymin - d; + d = 1.0e-5 * ( zmax - zmin ); + zmax_adjusted = zmax + d; + zmin_adjusted = zmin - d; + cx = basex / ( xmax_adjusted - xmin_adjusted ); + cy = basey / ( ymax_adjusted - ymin_adjusted ); + zscale = height / ( zmax_adjusted - zmin_adjusted ); + saz = sin( dtr * az ); + caz = cos( dtr * az ); + salt = sin( dtr * alt ); + calt = cos( dtr * alt ); - plsc->domxmi = xmin; - plsc->domxma = xmax; - plsc->domymi = ymin; - plsc->domyma = ymax; + plsc->domxmi = xmin_adjusted; + plsc->domxma = xmax_adjusted; + plsc->domymi = ymin_adjusted; + plsc->domyma = ymax_adjusted; plsc->zzscl = zscale; - plsc->ranmi = zmin; - plsc->ranma = zmax; + plsc->ranmi = zmin_adjusted; + plsc->ranma = zmax_adjusted; plsc->base3x = basex; plsc->base3y = basey; - plsc->basecx = 0.5 * ( xmin + xmax ); - plsc->basecy = 0.5 * ( ymin + ymax ); + plsc->basecx = 0.5 * ( xmin_adjusted + xmax_adjusted ); + plsc->basecy = 0.5 * ( ymin_adjusted + ymax_adjusted ); // Mathematical explanation of the 3 transformations of coordinates: // (I) Scaling: // x' = cx*(x-x_mid) = cx*(x-plsc->basecx) // y' = cy*(y-y_mid) = cy*(y-plsc->basecy) -// z' = zscale*(z-zmin) = zscale*(z-plsc->ranmi) +// z' = zscale*(z-zmin_adjusted) = zscale*(z-plsc->ranmi) // (II) Rotation about z' axis clockwise by the angle of the azimut when // looking from the top in a right-handed coordinate system. // x'' x' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |