all the best!
working on the 2 bar magnet now. it works now!
thanks for
[code]    bf1=getB(x*cs+y*sc,-x*sc+y*cs,xMagnet*cs+yMagnet*sc,-xMagnet*sc+yMagnet*cs);//FKH
      bf2=getB(x*cs2+y*sc2,-x*sc2+y*cs2,xMagnet2*cs2+yMagnet2*sc2,-xMagnet2*sc2+yMagnet2*cs2);//FKH
      //xField[i][j] = b[0];
      //yField[i][j] = b[1];
      xField[i][j] = bf1[0]*cs-bf1[1]*sc+bf2[0]*cs2-bf2[1]*sc2;//FKH
      yField[i][j] = bf1[0]*sc+bf1[1]*cs+bf2[0]*sc2+bf2[1]*cs2;//FKH
//      magField[i][j]=b[2];
      magField[i][j]=Math.sqrt(xField[i][j]*xField[i][j]+yField[i][j]*yField[i][j]);[/code]
this the code that made the 2 bar magnet work ;D