public int [ ] screenProjection ( double ... coord ) { double [ ] sc = new double [ 2 ] ; sc [ 0 ] = baseScreenCoords [ 0 ] [ 0 ] ; sc [ 1 ] = baseScreenCoords [ 0 ] [ 1 ] ; for ( int i = 0 ; i < canvas . base . dimension ; i ++ ) { sc [ 0 ] += ( ( coord [ i ] - canvas . base . baseCoords [ 0 ] [ i ] ) / ( canvas . base . baseCoords [ i + 1 ] [ i ] - canvas . base . baseCoords [ 0 ] [ i ] ) ) * ( baseScreenCoords [ i + 1 ] [ 0 ] - baseScreenCoords [ 0 ] [ 0 ] ) ; sc [ 1 ] += ( ( coord [ i ] - canvas . base . baseCoords [ 0 ] [ i ] ) / ( canvas . base . baseCoords [ i + 1 ] [ i ] - canvas . base . baseCoords [ 0 ] [ i ] ) ) * ( baseScreenCoords [ i + 1 ] [ 1 ] - baseScreenCoords [ 0 ] [ 1 ] ) ; } return new int [ ] { ( int ) sc [ 0 ] , ( int ) sc [ 1 ] } ; }
Project logical coordinates to Java2D coordinates .