code: public void transform(float source[], int sourceOffset, float destination[], int destOffset, int numberOfPoints) {   
          //TODO performance can be improved by removing the safety to the destination array   
          float result[] = source == destination ? new float[numberOfPoints * 2] : destination;
             
          for(int i=0;i<numberOfPoints * 2;i+=2) {   
              for(int j=0;j<6;j+=3) {   
                  result[i + (j / 3)] = source[i + sourceOffset] * matrixPosition[j] + source[i + sourceOffset + 1] * matrixPosition[j + 1] + 1 * matrixPosition[j + 2];   
              }   
          }   
          
          if (source == destination) {
  	        //for safety of the destination, the results are copied after the entire operation.   
  	        for(int i=0;i<numberOfPoints * 2;i+=2) {   
  	            destination[i + destOffset] = result[i];   
  	            destination[i + destOffset + 1] = result[i + 1];   
  	        }   
          }
      }
docs: Transform the point pairs in the source array and store them in the destination array.
  All operations will be done before storing the results in the destination.  This way the source
  and destination array can be the same without worry of overwriting information before it is transformed.
  
  @param source Array of floats containing the points to be transformed
  @param sourceOffset Where in the array to start processing
  @param destination Array of floats to store the results.
  @param destOffset Where in the array to start storing
  @param numberOfPoints Number of points to be transformed
  @throws ArrayIndexOutOfBoundsException if sourceOffset + numberOfPoints * 2 > source.length or the same operation on the destination array