protected void calcPositions(){
  for (int index=0; index < vertexArray.length; index++) {
    if (isMoveable[index]) {
      double deltaLength=Math.sqrt(dispX[index] * dispX[index] + dispY[index] * dispY[index]);
      if (deltaLength < 0.001) {
        deltaLength=0.001;
      }
      double newXDisp=dispX[index] / deltaLength * Math.min(deltaLength,temperature);
      double newYDisp=dispY[index] / deltaLength * Math.min(deltaLength,temperature);
      dispX[index]=0;
      dispY[index]=0;
      cellLocation[index][0]+=newXDisp;
      cellLocation[index][1]+=newYDisp;
    }
  }
}

protected void calcPositions ( ) { for ( int index = 0 ; index < vertexArray . length ; index ++ ) { if ( isMoveable [ index ] ) { double deltaLength = Math . sqrt ( dispX [ index ] * dispX [ index ] + dispY [ index ] * dispY [ index ] ) ; if ( deltaLength < 0.001 ) { deltaLength = 0.001 ; } double newXDisp = dispX [ index ] / deltaLength * Math . min ( deltaLength , temperature ) ; double newYDisp = dispY [ index ] / deltaLength * Math . min ( deltaLength , temperature ) ; dispX [ index ] = 0 ; dispY [ index ] = 0 ; cellLocation [ index ] [ 0 ] += newXDisp ; cellLocation [ index ] [ 1 ] += newYDisp ; } } }
takes the displacements calculated for each cell and applies them to the local cache of cell positions . limits the displacement to the current temperature .
