jDSGI - Java2D DATA Step Graphics Interface
  Back - Next   [ 2 of 27 ]
image  
by Richard A. DeVenezia, Copyright 2004  HOME
/*
 * Richard A. DeVenezia
 * June 1, 2004
 *
 * jDSGI test 2
 */

data _null_;

  if symexist('goutpath') then goutpath=symget('goutpath'); else goutpath=pathname('WORK');
  if symexist ('gsftype') then gsftype=symget('gsftype'); else gsftype='png';

  gsf = cats(goutPath,"\","test2");

  width  = 500;
  height = 500;

  %canvas (_g, width, height, 0ffffffx)

  * 0,0 -> ul  :  1,1 -> lr;
  cx = 0.75;
  cy = 0.75;

  r1 = cx**2 + cy**2;          * to ul;
  r2 = (1-cx)**2 + cy**2;      * to ur;
  r3 = cx**2 + (1-cy)**2;      * to ll;
  r4 = (1-cx)**2 + (1-cy)**2 ; * to lr;

  r1 = sqrt(r1);
  r2 = sqrt(r2);
  r3 = sqrt(r3);
  r4 = sqrt(r4);

  r = max (of r1-r4);

  n = 350;

  ulx = 0;
  uly = 0;

  do i = 0 to n;
    %translate (-ulx, -uly);

    f = i / n ;

    w = 1 + 2 * r * (1-f) * width  ;
    h = 1 + 2 * r * (1-f) * height ;

    ulx = cx * width  - w/2 ;
    uly = cy * height - h/2 ;

    %translate (ulx, uly);

    %setColorRGB (255 * f, 255 * f, 255);
    %fillArc (0,0,w,h,0,360);
  end;

  %canvas_saveAs (gsf, gsftype, savedAs);

  %canvas_delete();

  if savedAs ne '' then call system ("start " || savedAs);
run ;