1
1
//---------------------------------------------------------------------------//
2
// $Id: x18.java,v 1.7 2004/01/17 16:41:39 rlaboiss Exp $
2
// $Id: x18.java,v 1.15 2006/05/13 05:22:43 airwin Exp $
3
3
//---------------------------------------------------------------------------//
5
5
//---------------------------------------------------------------------------//
6
6
// Copyright (C) 2001 Geoffrey Furnish
7
7
// Copyright (C) 2002 Alan W. Irwin
8
// Copyright (C) 2004 Andrew Ross
9
10
// This file is part of PLplot.
20
21
// You should have received a copy of the GNU Library General Public License
21
22
// along with PLplot; if not, write to the Free Software
22
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23
24
//---------------------------------------------------------------------------//
25
26
//---------------------------------------------------------------------------//
38
final int NPTS = 1000;
39
static final int NPTS = 1000;
39
40
static int opt[] = { 1, 0, 1, 0 };
40
41
static double alt[] = {20.0, 35.0, 50.0, 65.0};
41
42
static double az[] = {30.0, 40.0, 50.0, 60.0};
42
PLStreamc plsdummy = new PLStreamc();
43
plplotjavac pls = new plplotjavac();
43
PLStream pls = new PLStream();
45
45
double THETA(int a)
53
53
void test_poly(int k)
57
{ true, true, true, true },
58
{ true, false, true, false },
59
{ false, true, false, true },
60
{ true, true, false, false }
63
63
double [] x = new double [5];
64
64
double [] y = new double [5];
65
65
double [] z = new double [5];
68
pls.plvpor(0.0, 1.0, 0.0, 0.9);
69
pls.plwind(-1.0, 1.0, -0.9, 1.1);
71
pls.plw3d(1.0, 1.0, 1.0, -1.0, 1.0, -1.0, 1.0, -1.0, 1.0, alt[k], az[k]);
72
pls.plbox3("bnstu", "x axis", 0.0, 0,
68
pls.vpor(0.0, 1.0, 0.0, 0.9);
69
pls.wind(-1.0, 1.0, -0.9, 1.1);
71
pls.w3d(1.0, 1.0, 1.0, -1.0, 1.0, -1.0, 1.0, -1.0, 1.0, alt[k], az[k]);
72
pls.box3("bnstu", "x axis", 0.0, 0,
73
73
"bnstu", "y axis", 0.0, 0,
74
74
"bcdmnstuv", "z axis", 0.0, 0);
78
78
// x = r sin(phi) cos(theta)
79
79
// y = r sin(phi) sin(theta)
102
102
y[4] = Math.sin( PHI(j) ) * Math.sin( THETA(i) );
103
103
z[4] = Math.cos( PHI(j) );
105
pls.plpoly3(x, y, z, draw[k], 1 );
105
pls.poly3(x, y, z, draw[k], true );
110
pls.plmtex("t", 1.0, 0.5, 0.5, "unit radius sphere" );
110
pls.mtex("t", 1.0, 0.5, 0.5, "unit radius sphere" );
112
112
// Does a series of 3-d plots for a given data set, with different
113
113
// viewing options in each plot.
153
153
for (k = 0; k < 4; k++) {
155
pls.plvpor(0.0, 1.0, 0.0, 0.9);
156
pls.plwind(-1.0, 1.0, -0.9, 1.1);
158
pls.plw3d(1.0, 1.0, 1.0, -1.0, 1.0, -1.0, 1.0, -1.0, 1.0, alt[k], az[k]);
159
pls.plbox3("bnstu", "x axis", 0.0, 0,
155
pls.vpor(0.0, 1.0, 0.0, 0.9);
156
pls.wind(-1.0, 1.0, -0.9, 1.1);
158
pls.w3d(1.0, 1.0, 1.0, -1.0, 1.0, -1.0, 1.0, -1.0, 1.0, alt[k], az[k]);
159
pls.box3("bnstu", "x axis", 0.0, 0,
160
160
"bnstu", "y axis", 0.0, 0,
161
161
"bcdmnstuv", "z axis", 0.0, 0);
166
pls.plline3( x, y, z );
166
pls.line3( x, y, z );
168
pls.plpoin3( x, y, z, 1 );
168
pls.poin3( x, y, z, 1 );
171
171
String title = "#frPLplot Example 18 - Alt=" +
172
172
nf.format((int) alt[k]) +
174
174
nf.format((int) az[k]);
175
pls.plmtex("t", 1.0, 0.5, 0.5, title);
175
pls.mtex("t", 1.0, 0.5, 0.5, title);