|
From: <and...@us...> - 2013-11-25 06:30:07
|
Revision: 12748
http://sourceforge.net/p/plplot/code/12748
Author: andrewross
Date: 2013-11-25 06:30:00 +0000 (Mon, 25 Nov 2013)
Log Message:
-----------
Easier way to rescale the velocity vectors in example 22.
Modified Paths:
--------------
trunk/examples/c/x22c.c
trunk/examples/c++/x22.cc
Modified: trunk/examples/c/x22c.c
===================================================================
--- trunk/examples/c/x22c.c 2013-11-24 22:01:17 UTC (rev 12747)
+++ trunk/examples/c/x22c.c 2013-11-25 06:30:00 UTC (rev 12748)
@@ -30,11 +30,11 @@
void potential( void );
void f2mnmx( PLFLT **f, PLINT nx, PLINT ny, PLFLT *fnmin, PLFLT *fnmax );
-// Pairs of points making the line segments used to plot the user defined arrow
-static PLFLT arrow_x[6] = { -1.0, 1.0, 0.6, 1.0, 0.6, 1.0 };
-static PLFLT arrow_y[6] = { 0.0, 0.0, 0.4, 0.0, -0.4, 0.0 };
-static PLFLT arrow2_x[6] = { -1.0, 0.6, 0.6, 1.0, 0.6, 0.6 };
-static PLFLT arrow2_y[6] = { 0.0, 0.0, 0.4, 0.0, -0.4, 0.0 };
+// Pairs of points making the line segments used to plot the user defined arroW
+static PLFLT arrow_x[6] = { -0.5, 0.5, 0.3, 0.5, 0.3, 0.5 };
+static PLFLT arrow_y[6] = { 0.0, 0.0, 0.2, 0.0, -0.2, 0.0 };
+static PLFLT arrow2_x[6] = { -0.5, 0.3, 0.3, 0.5, 0.3, 0.3 };
+static PLFLT arrow2_y[6] = { 0.0, 0.0, 0.2, 0.0, -0.2, 0.0 };
//--------------------------------------------------------------------------
// main
@@ -160,7 +160,7 @@
sprintf( title, "#frPLplot Example 22 - constriction (arrow style %d)", astyle );
pllab( "(x)", "(y)", title );
plcol0( 2 );
- plvect( (const PLFLT * const *) u, (const PLFLT * const *) v, nx, ny, -0.5, pltr2, (void *) &cgrid2 );
+ plvect( (const PLFLT * const *) u, (const PLFLT * const *) v, nx, ny, -1.0, pltr2, (void *) &cgrid2 );
plcol0( 1 );
plFree2dGrid( cgrid2.xg, nx, ny );
@@ -252,7 +252,7 @@
xmin + dx / 2, xmax - dx / 2, ymin + dy / 2, ymax - dy / 2,
clev, nc, 0, 1, 1.0, plfill, 1, NULL, NULL );
plvect( (const PLFLT * const *) u, (const PLFLT * const *) v, nx, ny,
- -0.5, pltr2, (void *) &cgrid2 );
+ -1.0, pltr2, (void *) &cgrid2 );
// Plot edges using plpath (which accounts for coordinate transformation) rather than plline
plpath( nseg, xmin, ymax, xmax, ymax );
plpath( nseg, xmin, ymin, xmax, ymin );
Modified: trunk/examples/c++/x22.cc
===================================================================
--- trunk/examples/c++/x22.cc 2013-11-24 22:01:17 UTC (rev 12747)
+++ trunk/examples/c++/x22.cc 2013-11-25 06:30:00 UTC (rev 12748)
@@ -157,7 +157,7 @@
sprintf( title, "#frPLplot Example 22 - constriction (arrow style %d)", astyle );
pls->lab( "(x)", "(y)", title );
pls->col0( 2 );
- pls->vect( u, v, nx, ny, -0.5, plstream::tr2, (void *) &cgrid2 );
+ pls->vect( u, v, nx, ny, -1.0, plstream::tr2, (void *) &cgrid2 );
pls->col0( 1 );
}
@@ -211,7 +211,7 @@
xmin + dx / 2, xmax - dx / 2, ymin + dy / 2, ymax - dy / 2,
clev, nc, 0, 1, 1.0, plstream::fill, 1, NULL, NULL );
pls->vect( (const PLFLT * const *) u, (const PLFLT * const *) v, nx, ny,
- -0.5, plstream::tr2, (void *) &cgrid2 );
+ -1.0, plstream::tr2, (void *) &cgrid2 );
// Plot edges using plpath (which accounts for coordinate transformation) rather than plline
pls->path( nseg, xmin, ymax, xmax, ymax );
pls->path( nseg, xmin, ymin, xmax, ymin );
@@ -343,10 +343,10 @@
bool fill;
// Set of points making a polygon to use as the arrow
- PLFLT arrow_x[6] = { -1.0, 1.0, 0.6, 1.0, 0.6, 1.0 };
- PLFLT arrow_y[6] = { 0.0, 0.0, 0.4, 0.0, -0.4, 0.0 };
- PLFLT arrow2_x[6] = { -1.0, 0.6, 0.6, 1.0, 0.6, 0.6 };
- PLFLT arrow2_y[6] = { 0.0, 0.0, 0.4, 0.0, -0.4, 0.0 };
+ PLFLT arrow_x[6] = { -0.5, 0.5, 0.3, 0.5, 0.3, 0.5 };
+ PLFLT arrow_y[6] = { 0.0, 0.0, 0.2, 0.0, -0.2, 0.0 };
+ PLFLT arrow2_x[6] = { -0.5, 0.3, 0.3, 0.5, 0.3, 0.3 };
+ PLFLT arrow2_y[6] = { 0.0, 0.0, 0.2, 0.0, -0.2, 0.0 };
// Create new plstream
pls = new plstream();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|