double[][] xg = new double[RPTS][THETAPTS]; double[][] yg = new double[RPTS][THETAPTS]; double[][] z = new double[RPTS][THETAPTS];
double[][] xg = new double[RPTS][THETAPTS-1]; double[][] yg = new double[RPTS][THETAPTS-1]; double[][] z = new double[RPTS][THETAPTS-1];
    void polar()    // polar contour plot example.    {	int i,j;        double[] px = new double[PERIMETERPTS];        double[] py = new double[PERIMETERPTS];        double[][] xg = new double[RPTS][THETAPTS];        double[][] yg = new double[RPTS][THETAPTS];        double[][] z = new double[RPTS][THETAPTS];	double t, r, theta;	double [] lev = new double[10];	pls.env(-1., 1., -1., 1., 0, -2);	pls.col0(1);           // Perimeter	for (i = 0; i < PERIMETERPTS; i++) {            t = (2.*Math.PI/(PERIMETERPTS-1))*(double)i;            px[i] = Math.cos(t);            py[i] = Math.sin(t);	}	pls.line(PERIMETERPTS, px, py);	           // Create data to be contoured.   	for (i = 0; i < RPTS; i++) {            r = i/(double)(RPTS-1);            for (j = 0; j < THETAPTS; j++) {                theta = (2.*Math.PI/(double)(THETAPTS-1))*(double)j;                xg[i][j] = r*Math.cos(theta);                yg[i][j] = r*Math.sin(theta);                z[i][j] = r;            }	}	for (i = 0; i < 10; i++) {            lev[i] = 0.05 + 0.10*(double) i;	}	pls.col0(2);        pls.cont( z, lev, xg, yg, 0 );	pls.col0(1);	pls.lab("", "", "Polar Contour Plot");    }