got it!!!!
i see now
dipoles[ i ][color=blue][ 0 ] [/color]= dipoles[ i ][color=blue][X][/color]
dipoles[ i ][color=red][1][/color] = dipoles[ i ][color=red][Y][/color]
no worries!
my earlier posts are wrong.
next i will try to make a general angle, see if i can understand the codes more.


[code]if (earth==true){
double dy=1.0/(nd-1);    //set up dipoles under bar magnet
for(int i=0; i  dipoles[i][1]=-0.5+i*dy;   // y position of first line of dipoles bottom
dipoles[i+1][1]=-0.5+i*dy;   // y position of 2nd line of dipoles top
 

dipoles[i][0]=-0.04;         // x position move down by -0.04 of first line of dipoles bottom
 dipoles[i+1][0]=0.04;       // x position move up by +0.04 of top line of dipoles bottom
// }

}
}

 else {

double dx=1.0/(nd-1);    //set up dipoles under bar magnet
for(int i=0; i  dipoles[i][0]=-0.5+i*dx;   // x position of first line of dipoles bottom
dipoles[i+1][0]=-0.5+i*dx;   // x position of 2nd line of dipoles top
 

dipoles[i][1]=-0.04;         // y position move down by -0.04 of first line of dipoles bottom
 dipoles[i+1][1]=0.04;       // y position move up by +0.04 of top line of dipoles bottom

}
}[/code]