i been looking at the codes

i have a question

i notice the test mass uses

evolution to move

dvxc/dt = -getF(-1,xc,yc,0)/m

dvyc/dt= -getF(-1,xc,yc,1)/m

where getF

double dx1,dy1,dx2,dy2,r12,r22,dx,dy,d,sign=-1;

public double getF (int i, double xi,double yi, int mode) {//return electric field

if(count>=n)return 0; // count >=n , do ntg

dx1=xi-x1; dy1=yi-y1;

dx2=xi-x2; dy2=yi-y2;

r12=dx1*dx1+dy1*dy1; r22=dx2*dx2+dy2*dy2;

if(i>-1){

if(add || out*)return 0.;*

// if( (x*>xmax && (y**-ymax)*(y**-ymin)>0) || (x**<xmin && (y**-ymax)*(y**-ymin)>0) || //(y**>ymax && (x**-xmax)*(x**-xmin)>0) || (y**<ymin && (x**-xmax)*(x**-xmin)>0) || *

if(xi>scale*xmax || yi>scale*ymax || xi<scale*xmin || yi<scale*ymin || r12<size22 || r22<size22) {

out*=true;// if electric field line move outside the drawing region too far=> do not need to following the field line any more*

count++;

return 0.;

}

}

if(i<np)sign=q1/Math.abs(q1); // question sign mean sign of q1 ?

else sign=q2/Math.abs(q2); // // question sign mean sign of q2 ?

dx=q1*dx1/(r12*Math.sqrt(r12))+q2*dx2/(r22*Math.sqrt(r22));

dy=q1*dy1/(r12*Math.sqrt(r12))+q2*dy2/(r22*Math.sqrt(r22));

d=Math.sqrt(dx*dx+dy*dy);

if(mode==0)return sign*dx/d; // question what does mode do?

else return sign*dy/d;

}

My thoughts:

i tested the codes in the applet, i change the

Q1 = + or -

Q2 = 0

and the test particles goes in the out of the view direction regardless of the signs of Q1.

it is a bug or i need to modify the codes more to reflect the sign of Q1 and Q2?